[R] POSIX and identify

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Sep 15 19:43:40 CEST 2003


You need to convert to POSIXct before using Dato in identify().
This will work as you expected in R 1.8.0.

On Mon, 15 Sep 2003, Troels Ring wrote:

> Dear Friends, I'm using winXP and R 1.7.1 and plotting some data using 
> dates on the x-axis, and wanted to use identify to show some points but was 
> told by identify that the x and y vectors producing a fine graph with 84 
> points were not equal in length. Below are the Dato for date - and 
> length(Dato) finds 9 but str finds 84 as known. Will identify not work in 
> this context ?
> Best wishes
> Troels Ring
> Aalborg, Denmark
>  > Dato
>   [1] "2000-01-04" "2000-01-07" "2000-01-10" "2000-01-13" "2000-01-17"
>   .......
> [81] "2003-04-23" "2003-05-14" "2003-07-30" "2003-08-14"
>  > length(Dato)
> [1] 9
>  > str(Dato)
> `POSIXlt', format: chr [1:84] "2000-01-04" "2000-01-07" "2000-01-10" 
> "2000-01-13" ...

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list