[18943] in s-news-athena
[S] is there a bug in plot.times/seq.dates?
daemon@ATHENA.MIT.EDU (Scott Dewey)
Sat Aug 14 11:17:18 1999
Date: Sat, 14 Aug 1999 10:58:13 -0400
Message-Id: <199908141458.KAA13257@rrdjazz.nist.gov>
From: Scott Dewey <msd@rrdjazz.nist.gov>
To: s-news@wubios.wustl.edu
Hi,
I'm running S-Plus 2000 on a W98 machine.
Recently I tried plotting two colums of numbers with x being a column
of dates:
> xx[,c("date","a21")]
date a21
s044r.015 07/29/1999 0.9798640
s044r.016 07/29/1999 0.9777131
s044r.017 07/30/1999 0.9744024
s044r.019 07/30/1999 0.9735205
s044r.020 07/30/1999 0.9643542
s044r.021 07/30/1999 0.9764769
s044r.022 07/30/1999 0.9751279
s044r.023 07/30/1999 0.9745305
s045r.002 08/04/1999 0.9742478
s045r.003 08/04/1999 0.9698257
s045r.004 08/04/1999 0.9762068
s045r.005 08/04/1999 0.9691110
s045r.006 08/04/1999 0.9732061
s047r.002 08/09/1999 1.0270195
s047r.009 08/09/1999 1.0240457
s047r.010 08/09/1999 1.0305092
s048r.007 08/09/1999 1.0255152
s048r.001 08/10/1999 1.0262794
s049r.001 08/10/1999 1.0238883
When I issued the command: plot(xx$date,xx$a21), I got the following
error:
Error: Missing values not allowed
Error in axis
>
I believe the problem is in the seq.dates function:
xxx <- its(x=xx$a21,times=xx$date)
x1 <- time(xxx, origin.julian = c(1, 1, 1960))
> x1
[1] 07/29/1999 07/29/1999 07/30/1999 07/30/1999 07/30/1999 07/30/1999 07/30/1999 07/30/1999 08/04/1999 08/04/1999 08/04/1999 08/04/1999
[13] 08/04/1999 08/09/1999 08/09/1999 08/09/1999 08/09/1999 08/10/1999 08/10/1999
>
And this is the problem:
> seq(from = x1[1], to = x1[length(x1)], by = "days")
[1] 07/29/1999 07/30/1999 07/31/1999 08/01/1999 08/02/1999 08/03/1999 08/04/1999 08/05/1999 08/06/1999 08/07/1999 08/08/1999 08/09/1999
[13] NA
>
This NA is causing the grief (I think NA should be 08/10/1999). Does
anyone know about this situation? Does anyone have any thoughts about
this? I can start going through seq.dates to find out what's going
on, but I'm getting tired of going through S code. When the "by"
isn't by "days", the plotting can work.
Thanks,
Scott
--
M. Scott Dewey Email: msd@rrdjazz.nist.gov
National Institute of Standards & Technology
Ionizing Radiation Division
100 Bureau Drive, Mail Stop 8461 Tel: +1 301-975-4843
Gaithersburg, MD 20899-8461 FAX: +1 301-926-1604
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news