I have been able to use the getSymbols function to draw financial data from the default source (yahoo) successfully from within RStudio. When I tried to run this in a script from the command line, this fails and returns no data. The same when I manually enter the command from the command line.
Code:
library(quantmod)
args <- commandArgs(FALSE)
options("getSymbols.warning4.0"=FALSE)
getSymbols("APL")
chartSeries(APL, subset='last 1 months')
saveChart('png')
Error:
Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, :
unable to connect to 'chart.yahoo.com' on port 80.
I'm executing this from a VM running Windows Server 2008. Any ideas? I want to be able to call this code from PHP to update a figure when the user visits a page