Skip to content
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

Feature request: Ignore empty packages in session_info() #65

Closed
2 tasks done
phargarten2 opened this issue May 5, 2022 · 1 comment
Closed
2 tasks done

Feature request: Ignore empty packages in session_info() #65

phargarten2 opened this issue May 5, 2022 · 1 comment

Comments

@phargarten2
Copy link

Thank you for the easy and aesthetically pleasing package of information via session_info().

In my work, I list the packages used in every R file and then combine them at the end. At times, an empty string appears in the character vector sent to argument package (package = ""). The function yields an error:

xfun::session_info(packages = c("", "xfun"))
Error in isNamespaceLoaded(pkg) : 
  attempt to use zero-length variable name

The error indicates that removing an empty string from package would give the result.

>  xfun::session_info(packages = c("xfun"))
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042), RStudio 2022.2.2.485

Locale:
  LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
  LC_TIME=English_United States.utf8    

Package version:
  graphics_4.2.0  grDevices_4.2.0 stats_4.2.0     tools_4.2.0     utils_4.2.0     xfun_0.30  

What I would like is for the function to ignore "" and give the results of the non-empty strings (in this case xfun.) instead of preparing packages with no empty strings. The result would be the information above using the call xfun::session_info(packages = c("", "xfun"))


By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • [] I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('xfun'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/xfun').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

[Given that this is a feature request for this function, I didn't ask on Stack Overflow.]

@yihui yihui closed this as completed in a24898e May 5, 2022
@yihui
Copy link
Owner

yihui commented May 5, 2022

Done. Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants