How to load CSV data file into R for use with quantmod

前端 未结 3 847
迷失自我
迷失自我 2020-12-29 01:54

I am new to R and have just started to use it. I am currently experimenting with the quantmod package.

The quantmod package seems to do most of what I want to do, ho

3条回答
  •  轮回少年
    2020-12-29 02:36

    I can make it work, but you have to determine which parameters are needed for your setup.

    library(quantmod)
    
    # create sample data
    getSymbols("SPY")
    write.zoo(SPY, file="SPY.csv", sep=",")
    
    # set symbol lookup
    setSymbolLookup(SPY=list(src="csv",format="%Y-%m-%d"))
    # call getSymbols(.csv) with auto.assign=FALSE
    spy <- getSymbols("SPY", auto.assign=FALSE)
    barChart(spy)
    

提交回复
热议问题