title: Script works fine in Rstudio but not in Rscript
body: <p>I would like to schedule a R script which works fine via Rstudio. But when try to run the script with Rscript I got an error. The script take some parameters in a csv file and try to gather data on opentsdb. </p>
  
  <pre><code>library(devtools)
  install_local("/home/me/Downloads/opentsdbr-master")
  install_local("/home/me/Downloads/nomalyDetection-master")
  install_local("/home/me/Downloads/anomalydots", force="TRUE")
  install_local("/home/me/Downloads/RAD")
  library(reticulate)
  library(anomalydots)
  lbrary('methods')
  
  l &lt;- read.csv(file = "/home/bbtex/Downloads/metrics_list.csv", sep = ",")
  n &lt;- length(l$metrics)
  for (i in 1:n){
    tag=as.character(l$tags[i])
    metric=as.character(l$metrics[i])
    tag=eval(parse(text=paste("c(",tag,")",sep="")))
    newdata=getTsOpenTSDBOptimized(metric=metric,hostname="opentsdb-read.intcs.meshcore.net",port=4242,downsample=10,endDate=as.character(Sys.Date()),agg=l$agg[i],tags=tag)
    newdata = anomalydots::fillHoles2(newdata)
    newdata = anomalydots::timeSeriePreparation(newdata)
    timeseries[[i]] &lt;- newdata
  }
  print ("Upload completed successfully")
  </code></pre>
  
  <p>When I run the following code with Rscript I have the following error:</p>
  
  <blockquote>
    <p>Error in tsd_get_ascii(metric, interval, tags, agg, rate, downsample, 
    : 
        Calls: getTsOpenTSDBOptimized -> getTsOpenTSDB -> tsd_get -> tsd_get_ascii
        In addition: Warning messages:
        1: In tsd_get_ascii(metric, interval, tags, agg, rate, downsample,  :
          Response code 503
        2: In tsd_get_ascii(metric, interval, tags, agg, rate, downsample,  :
          URL: <a href="http://opentsdb-read.intcs.meshcore.net:4242/q?start=2018%2F10%2F19-02%3A00%3A00&amp;m=avg%3A600s-sum%3Adb.mysql.threads_connected%7Bhost%3Dbpct4005s%7D&amp;end=2018%2F10%2F22-01%3A59%3A59&amp;ascii=" rel="nofollow noreferrer">http://opentsdb-read.intcs.meshcore.net:4242/q?start=2018%2F10%2F19-02%3A00%3A00&amp;m=avg%3A600s-sum%3Adb.mysql.threads_connected%7Bhost%3Dbpct4005s%7D&amp;end=2018%2F10%2F22-01%3A59%3A59&amp;ascii=</a>
        Execution halted</p>
  </blockquote>
  
  <p>When I follow the link in the error, I can see the data printed in the webpage.
  Thank you in advance for your help</p>