[R] x is not a open/high/low/close time series

Dirk Eddelbuettel edd at debian.org
Mon Oct 18 20:03:21 CEST 2004

On Mon, Oct 18, 2004 at 09:33:35AM -0700, Dean Sonneborn wrote:
> I am trying to create a high low close style chart but I keep getting the 
> following error statement; "x is not a open/high/low/close time 
> series".  I've used the function is.ts and R responds TRUE but the 
> ohlcPlot  function gives the above error statement. I'm actually planning 
> to plot some odds ratios with their confidence intervals and the 
> hi-low-close chart should do the job if I can just figure out what the 
> ohlcPlot  function is expecting the time series data to look like.

If you do 'example(plotOHLC)', an object x is created, and a subsequent
'class(x)' tells you that it is of class 'mts' -- a multiple timeseries

Similar code and functionality using another data type is in the its package
on CRAN. You may find that easier to use. Depending on your R skills, you
can also factor out the OHLC plotting code and apply to data.frames or other
data containers.

Hth, Dirk

Those are my principles, and if you don't like them... well, I have others.
                                                -- Groucho Marx

More information about the R-help mailing list