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

Proper Way to Load Libraries in .Rprofile #446

Closed
nateybear opened this issue Feb 20, 2022 · 3 comments
Closed

Proper Way to Load Libraries in .Rprofile #446

nateybear opened this issue Feb 20, 2022 · 3 comments

Comments

@nateybear
Copy link

I'm raising this issue to ask for advice on library loading when the RCall session starts up. I have a .Rprofile in my working directory like this:

print("inside of R profile")
require(tidyverse)

I would expect the tidyverse library to be loaded and available in my REPL, however I get an error:
Screen Shot 2022-02-20 at 3 37 43 PM
I like to load a "base" set of R libraries in my .Rprofile for when my R session starts up, and the behavior of RCall does not line up in this sense with my typical R workflow.

Any advice on loading libraries in a startup script is appreciated!

@simonbyrne
Copy link
Member

What OS are you on?

@nateybear
Copy link
Author

nateybear commented Feb 21, 2022

@simonbyrne macOS Big Sur (11.6.1), I'm running Julia 1.6.3 and R 4.0.2

@palday
Copy link
Collaborator

palday commented Jul 16, 2024

My recommendation is to use library instead of require to throw an effort when package loading fails. Alternatively, check the return value of require. My strong suspicion is that something is going wrong in loading tidyverse and hence magittr (which is where the pipe operator %>% is actually defined).

@palday palday closed this as completed Jul 16, 2024
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

3 participants