title: Rstudio EC2 - loading certain packages fails
body: <p>I am running RStudio via AWS EC2 instance. In preparation of implementing a cron job for an R script, I have set up the following test script (named 'TestBatch.R' and stored in my EC2 ubuntu home directory):</p>
  
  <pre><code>setwd("/home/path")
  filename &lt;- "_test.txt"
  filename &lt;- paste(as.character(Sys.time()), filename, sep="")
  data &lt;- paste("Output for ", as.character(Sys.time()), sep="")
  write(x=data,file=filename)
  </code></pre>
  
  <p>I execute the test script without any problems via...</p>
  
  <pre><code>sudo R CMD BATCH TestBatch.R
  </code></pre>
  
  <p>...and the output is stored in the desired location. </p>
  
  <p>The problem arises when I augment the above R script to load certain packages, for example:</p>
  
  <pre><code>setwd("/home/path")
  library(XML)
  filename &lt;- "_test.txt"
  filename &lt;- paste(as.character(Sys.time()), filename, sep="")
  data &lt;- paste("Output for ", as.character(Sys.time()), sep="")
  write(x=data,file=filename)
  </code></pre>
  
  <p>In this case the code seems to fail, i.e. no output is stored. The problem only occurs for some packages while it works for others (e.g. 'plyr'). Note that I have installed all relevant packages via the Rstudio EC2 browser interface.  </p>
  
  <p>What could be the problem and how can I solve it? Please provide an answer for an ubuntu newbie</p>