Thanks. So, to make R aware of RStudio's resources, do I just need to set some variables in the .Renviron file that R uses? If that's true, and someone can point me to the environment variable names, maybe I'll have a systematic solution.
Expanding from your answer, I opened RStudio and ran
sink(file = "~/RStudioEnv.txt")
Sys.getenv()
sink()
then opened R and ran
sink(file = "~/REnv.txt")
Sys.getenv()
sink()
When I compared "~/RStudioEnv.txt" to "~/REnv.txt", I found that RStudio had 13 environmental variables that were not in R's environment. Four seemed to point to resources that my R session might need:
- RMARKDOWN_MATHJAX_PATH
- RSTUDIO_MSYS_SSH
- RSTUDIO_PANDOC
- RSTUDIO_WINUTILS
(the other nine were: GFORTRAN_STDERR_UNIT, GFORTRAN_STDOUT_UNIT, RS_LOCAL_PEER, RS_RPOSTBACK_PATH, RS_SHARED_SECRET, RSTUDIO, RSTUDIO_SESSION_PORT, RSTUDIO_USER_IDENTITY, SESSIONNAME).
Are there four analogous environmental variables that my R session will look for, which I could created using the folder paths the RStudio variables use? Or maybe I can put something in .Renviron that will add those four folder paths to my PATH. If there is a "right" or recommended approach to this kind of thing in R, please let me know.