Reputation: 13
library(quantmod)
getSymbols('AAPL')
n <- nrow(AAPL)
a <- runif(n)
I would like to convert a
to an xts object with dates equal to the dates of AAPL
.
So far I wasn't able to do it by any way.
Upvotes: 1
Views: 397
Reputation: 176648
This is very simple:
a <- xts(runif(nrow(AAPL)), index(AAPL))
Upvotes: 2