I have been having some weird issues with R (3.1.1) and RStudio (0.98.1079) and I suspect that it is due to the fact that these programs are not longer referencing the right places after I upgraded to Mac OSX 10.10.
In particular, I cannot seem to find packages that I know I have installed on my computer to run using the system
command in the R console. That is, running man pdflatex
in a Terminal window yields the help manual for PDFLATEX. However running system('man pdflatex')
from the R console yields the error message No manual entry for pdflatex.
The issue persists even though I reinstalled R, RStudio and MacTex since I upgraded to Mac OSX 10.10. Any help would be appreciated!
In the Script Editor app on your Mac, click the Run button in the toolbar, or press Command-R, to execute the commands in your script.
The home location for R packages from the Mac finder on my machine is "desktop/Macintosh HD/Library/Frameworks/R. framework/Resources/library/". Within library you will see all the packages that you have downloaded, and installed.
Yosemite has a bug wherein some environment variables, including PATH
, appear twice in a program's environment with different values. For instance, you might notice that Sys.getenv("PATH")
will show you one PATH, and system("echo $PATH")
will show you an entirely different one.
I expect that most of your problems are due to this bug.
There are a few workarounds you can try immediately:
You can manually forward PATH
yourself. Try this:
> system2("man", "pdflatex", env=paste0("PATH=", Sys.getenv("PATH")))
Or, you can start RStudio from Terminal:
$ open /Applications/RStudio.app
Both the R and RStudio engineers have implemented workarounds in the last few days. R (as of 3.1.2) and RStudio (as of 0.98.1087) should behave as you'd expect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With