[R-SIG-Finance] Numeric to timeSeries help
josh.m.ulrich at gmail.com
Mon Mar 26 15:20:27 CEST 2012
On Mon, Mar 26, 2012 at 7:59 AM, Golam Sakline <golam.sakline at gmail.com> wrote:
> Can someone quickly help me with few lines of code or point me to a site that shows how to merge a numeric class object column with time column of getSymbol object and plot it in quantmod chartSeries.
There's no such thing as a "getSymbol" object. By default getSymbols
returns an xts object. xts objects do not have a "time column"; they
have an index attribute that stores the date/time.
What did you try? This works:
x <- xts(1:10, Sys.Date()+1:10)
x <- merge(x,10:1)
Joshua Ulrich | FOSS Trading: www.fosstrading.com
R/Finance 2012: Applied Finance with R
More information about the R-SIG-Finance