简体   繁体   中英

How to load rda/RData files in an environment using quantmod

As the question ask how can I load rda/RData files with stock time series in an environment using quantmod

I am downloading AAPL time series data using this code

data <- getSymbols("AAPL",auto.assign=FALSE)
save(data,file="/home/user/folder/AAPL.rda")
rm(data)

I want to load AAPL.rda files in an environment using quantmod and I tried this

data<-new.env()
getSymbols("/home/user/folder/AAPL", src="rda", env=data, auto.assign=FALSE)

and it shows AAPL's time series in command line

2009-08-28    172.27    172.49   168.53     170.05   113425200      22.36121
2009-08-31    168.16    168.85   166.50     168.21    77834400      22.11925
2009-09-01    167.99    170.00   164.94     165.30   117257000      21.73660
2009-09-02    164.62    167.61   164.11     165.18    91062300      21.72082

but its not loading to the data enviroment

> ls(data)
character(0)

How to find solution for this?

库(financialInstriments)就是你想要的...函数getSymbols.FI()会做你想要的exaclty ... setSymbolLookup()是另一个..你把.rda文件保存在这样的文件夹中.... data1 / data1你工作目录里的.rda ......

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM