[R] Date and lattice
Petr PIKAL
petr.pikal at precheza.cz
Mon Nov 19 16:56:59 CET 2007
r-help-bounces at r-project.org napsal dne 19.11.2007 15:38:26:
> Petr PIKAL <petr.pikal <at> precheza.cz> writes:
>
> >
> > I just encountered a strange behaviour trying to plot lattice xyplot
with
> > dates on x axis
> >
> > xyplot(rnorm(10)~seq(as.Date("2000/1/1"), by="month",
> > length=10)|sample(1:2, 10, replace=T))
> >
> > Warning message:
> > is.na() applied to non-(list or vector) in: is.na(x)
> >
> > and no points were plotted.
>
> Your example and my attempt to understand what it means works for me:
> R 2.6.0, Windows 2000 english, german date settings. Could it be a
problem with
> cz date settings?
>
> df = data.frame(val=rnorm(10),
> dt=seq(as.Date("2000/1/1"), by="month", length=10),
> group=sample(1:2, 10, replace=T))
> df
> xyplot(val~dt|group,data=df)
Well I tried but (with R --vanilla:
> search()
[1] ".GlobalEnv" "package:stats" "package:graphics"
"package:grDevices" "package:utils" "package:datasets"
"package:methods"
[8] "Autoloads" "package:base"
> library(lattice)
> df = data.frame(val=rnorm(10),
+ dt=seq(as.Date("2000/1/1"), by="month", length=10),
+ group=sample(1:2, 10, replace=T))
> xyplot(val~dt|group,data=df)
Warning message:
is.na() applied to non-(list or vector) in: is.na(x)
> Sys.getlocale()
[1] "LC_COLLATE=Czech_Czech Republic.1250;LC_CTYPE=Czech_Czech
Republic.1250;LC_MONETARY=Czech_Czech
Republic.1250;LC_NUMERIC=C;LC_TIME=Czech_Czech Republic.1250"
> Sys.setlocale("LC_ALL", "C")
[1] "LC_COLLATE=C;LC_CTYPE=English_United
States.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=C"
> xyplot(val~dt|group,data=df)
Warning message:
is.na() applied to non-(list or vector) in: is.na(x)
> Sys.setlocale("LC_ALL", "G")
[1]
"LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252"
> xyplot(val~dt|group,data=df)
Warning message:
is.na() applied to non-(list or vector) in: is.na(x)
Everything with same plotting results. The only problem can be with my
R version 2.6.0 Under development (unstable) (2007-05-19 r41638)
and I can not install R 2.6.1rc as somethinmg changed and I do not have
write permission to required folder (I has to check with our IT guys).
Thanks
Petr
>
> Dieter
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list