-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding attached
parameter to session_info() and package_info()
#42
Comments
You can filter the data frame that is returned, it has an ❯ pi <- sessioninfo::package_info()
❯ subset(pi, attached)
package * version date lib source
cli * 2.2.0.9000 2021-01-21 [1] local
crayon * 1.3.4.9000 2020-12-29 [1] local
[1] /Users/gaborcsardi/Library/R/4.0/library
[2] /Library/Frameworks/R.framework/Versions/4.0/Resources/library If you want the complete session info, |
Thank you for getting back so quickly! I did look through the code yesterday, and I saw that packages was returned as a data.frame. I guess the utility I see is being able to do:
versus
The former is more elegant, and much easier to debug remotely what others got going on in their session with a single command versus three; it also has the output in a more compact form. I took a stab at a PR, but apparently it's a bit more than just editing as:
and
and additionally,
The way dependencies are handled was a bit confusing for me, as I couldn't get the above to work locally, as expected. |
I am reluctant to add this, because it does not seem like a feature that is often needed (in fact, I don't really understand why you would want an incomplete session info in the first place), and because it (obviously) complicates the code base. |
OK, I'll think about this, maybe we could make the |
You can now write session_info("!attached") to list the attached packages only. |
Thank you for creating and maintaining such a useful package!
I think there is some use case to return the session_info() and package_info() for the attached packages only. Example here: https://www.tidymodels.org/learn/work/bayes-opt/
A parameter that allows for this would save some trimming on the user's side.
The text was updated successfully, but these errors were encountered: