How to have Rscript load my Rprofile

I have a script

test.R

library(dplyr)
print(1+1)

When I try to execute

>Rscript "test.R"
During startup - Warning message:
Setting LC_CTYPE=en_US.UTF-8 failed
Error in library(dplyr) : there is no package called 'dplyr'
Execution halted

There are a few problems. It doesn't seem to have loaded my profile, so there are issues with the location, the path to my packages, etc. I know how to set a profile path, but is there a more streamlined solution? If I launch R.exe it seems to work fine. I don't know why Rscript.exe has these issues.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.