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

Packages not showing as installed when .Rprofile running #1650

Closed
jabenninghoff opened this issue Aug 16, 2023 · 2 comments · Fixed by #1652
Closed

Packages not showing as installed when .Rprofile running #1650

jabenninghoff opened this issue Aug 16, 2023 · 2 comments · Fixed by #1652

Comments

@jabenninghoff
Copy link

Starting in renv 1.0.0, I get an unexpected message when starting R in one of my packages (https://github.com/jabenninghoff/jbplot)

ℹ Loading jbplot
ℹ The package "ggplot2" is required.
✖ Would you like to install it?

1: Yes
2: No

After doing some troubleshooting, this appears to be happening because some packages are not detected during execution of the .Rprofile. Running renv::diagnostics() inside .Rprofile after source("renv/activate.R") reports the following in the Status section:

# Status ---------------------------------------------------------------------
The following package(s) are missing:

 package      installed recorded used
 colorspace   n         y        ?   
 farver       n         y        ?   
 ggplot2      n         y        y   
 gtable       n         y        ?   
 isoband      n         y        ?   
 labeling     n         y        ?   
 munsell      n         y        ?   
 RColorBrewer n         y        ?   
 scales       n         y        ?   
 showtext     n         y        y   
 showtextdb   n         y        ?   
 sysfonts     n         y        ?   
 viridisLite  n         y        ?   

See ?renv::status() for advice on resolving these issues.

Running renv::diagnostics() again after R starts reports:

# Status ---------------------------------------------------------------------
No issues found -- the project is in a consistent state.
@kevinushey
Copy link
Collaborator

Thanks for the bug report! By any chance, does this issue only reproduce in RStudio and not within R terminal sessions?

We made a change recently that ensures the project is loaded within an RStudio session init hook, which is something that happens "later", soon-after the rest of the R session has finished initialization. I suspect you're running into trouble due to this issue.

@jabenninghoff
Copy link
Author

You are correct, itt does work correctly in R terminal sessions, thanks for the quick fix!

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

Successfully merging a pull request may close this issue.

2 participants