quantmod

How do I rename an R object?

爱⌒轻易说出口 提交于 2019-11-26 22:45:54
问题 I'm using the quantmod package to import financial series data from Yahoo. library(quantmod) getSymbols("^GSPC") [1] "GSPC" I'd like to change the name of object "GSPC" to "SPX". I've tried the rename function in the reshape package, but it only changes the variable names. The "GSPC" object has vectors GSPC.Open, GSPC.High, etc. I'd like my renaming of "GSPC" to "SPX" to also change GSPC.Open to SPX.Open and so on. 回答1: Renaming an object and the colnames within it is a two step process: SPY

Can't download data from Yahoo Finance using Quantmod in R

最后都变了- 提交于 2019-11-26 22:25:07
I'm trying to download data from Yahoo using this code: library(quantmod) getSymbols("WOW", auto.assign=F) This has worked for me in the past in every occasion except now, 5 days before my group assignment is due. Except now I receive this error: Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, : cannot download all files In addition: Warning message: In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, : URL 'https://ichart.finance.yahoo.com/table.csv? s=WOW&a=0&b=01&c=2007&d=4&e=17&f=2017&g=d&q=q&y=0&z=WOW&x=.csv': status was '502 Bad Gateway' The

Quantmod Error 'cannot open URL'

社会主义新天地 提交于 2019-11-26 18:29:18
问题 I started to experience an error today with the quantmod package. Anybody else have the same error when running this code (or requesting symbols in general)? library(quantmod) getSymbols("CPIAUCNS",src="FRED") Error: Error in download.file(paste(FRED.URL, "/", Symbols[[i]], "/", "downloaddata/", : cannot open URL 'http://research.stlouisfed.org/fred2/series/CPIAUCNS/downloaddata/CPIAUCNS.csv' The URL itself works fine. 回答1: FRED changed the URL scheme from http:// to https://. I'm working on

Error in model.frame.default: variable lengths differ

半腔热情 提交于 2019-11-26 16:34:40
问题 On running a gam model using the mgcv package, I encountered a strange error message which I am unable to understand: “Error in model.frame.default(formula = death ~ pm10 + Lag(resid1, 1) + : variable lengths differ (found for 'Lag(resid1, 1)')”. The number of observations used in model1 is exactly the same as the length of the deviance residual, thus I think this error is not related to difference in data size or length. I found a fairly related error message on the web here, but that post

Can't download data from Yahoo Finance using Quantmod in R

感情迁移 提交于 2019-11-26 12:19:29
问题 I\'m trying to download data from Yahoo using this code: library(quantmod) getSymbols(\"WOW\", auto.assign=F) This has worked for me in the past in every occasion except now, 5 days before my group assignment is due. Except now I receive this error: Error in download.file(paste(yahoo.URL, \"s=\", Symbols.name, \"&a=\", from.m, : cannot download all files In addition: Warning message: In download.file(paste(yahoo.URL, \"s=\", Symbols.name, \"&a=\", from.m, : URL \'https://ichart.finance.yahoo

Access odd-named object returned by getSymbols

耗尽温柔 提交于 2019-11-26 11:38:37
问题 I\'m downloading data from Yahoo using quantmod : > getSymbols(\"HNZ-A.TO\") [1] \"HNZ-A.TO\" Warning message: In download.file(paste(yahoo.URL, \"s=\", Symbols.name, \"&a=\", from.m, : downloaded length 70893 != reported length 200 The file shows up in my R workspace. The data is there and I can use edit to see the object, but I can\'t use the object. For example: > head(HNZ-A.TO) Error in head(HNZ - A.TO) : object \'HNZ\' not found What can I do to use this object? 回答1: Use back-ticks or