<div dir="ltr">Thanks again Dirk, is there a way that I can specify the root R directory? I want to keep the working directory as is but when a library folder is referenced as in the case with grDevices, i would like it to use $(R_HOME)\library\grDevices\.... The root R folder isn't being picked up correctly. I do have a $R_HOME  environment variable set up but it appears not be used. Here's the script that i'm running via calls to the RInside library, each call works until I get to ggsave(...) and at that point i get the error message about not being able to find the file <span style="color:rgb(0,0,0);white-space:pre-wrap">'?,x`/library/grDevices/afm/Helvetica.afm'</span><div><br></div><div>require(graphics)</div><div>library("ggplot2")</div><div>nmmaps<-read.csv("C:/path/to/datafiles/data.csv",<a href="http://as.is">as.is</a>=T)</div><div>nmmaps$date<-as.Date(nmmaps$date)</div><div>nmmaps<-nmmaps[nmmaps$date>as.Date("1996-12-31"),]</div><div>nmmaps$year<-substring(nmmaps$date,1,4)</div><div>head(nmmaps)</div><div>ggplot(nmmaps,aes(date,temp, color=factor(season)))+geom_point()</div><div><br></div><div>ggsave("C:/Path/to/file/myimage.pdf", encoding="C:/R/R-3.2.4/library/grDevices/enc/WinAnsi")  </div><div><br></div><div><br></div><div>Thank you,</div><div>Michael</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 1, 2016 at 9:49 AM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 1 April 2016 at 09:29, Michael Morrison wrote:<br>
| Thanks for your reply, much appreciated. The call works just fine if I make it<br>
| from the R GUI or R studio. I tested out the calls there first before trying to<br>
| make the same calls from RInside. Do you know if there's a way that the base<br>
| directory can be set through some other call?<br>
<br>
In R:     setwd()<br>
<br>
In C++:   chdir()<br>
<span class="HOEnZb"><font color="#888888"><br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
</font></span></blockquote></div><br></div>