You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(quantmod)
tickers <- c("AAPL", "TSLA")
getSymbols(tickers, env = stocks <- new.env())
L <- eapply(stocks, function(x) Cl(x) + Vo(x) * 1i)
res <- do.call("cbind", L)
## Error in merge.xts(..., all = all, fill = fill, suffixes = suffixes) :
## REAL() can only be applied to a 'numeric', not a 'complex'
If we convert to zoo and back then we do not get any errors:
library(xts)
data(sample_matrix)
x<- as.xts(sample_matrix)
y<-x[1:5,1] *1iz<-x[3:9,4] *1ia<- merge(y, z)
# Error in merge.xts(y, z) : # REAL() can only be applied to a 'numeric', not a 'complex'
Regarding the quantmod example what would be nice would be if a column could contain the entire OHLCV rather than just close and volulme. Would it be feasible to support a new tuple type that is like complex except it would allow each column to contain multiple columns, not just 2 like complex does.
This gives an error:
If we convert to zoo and back then we do not get any errors:
The text was updated successfully, but these errors were encountered: