[R] xyplot sorted by date

Ptit_Bleu ptit_bleu at yahoo.fr
Wed Dec 10 15:37:39 CET 2008


Hello

I have a dataframe with 3 columns C1, C2 and C3.
C1 and C2 are numerical data and C3 is the date of the data (format :
%Y-%m-%d %H:%M:%S")

With the lattice package, I would like to plot C1 as function of C2 sorted
by the dates, that is something like :
xyplot(C1 ~ C2 | as.Date(C3))

It plots somethings but not the truth.
I have compared the output with the output of this script

x11(15,12)
layout(matrix(1:4,2,2)
plot(C1[C3=='2008-12-06'] ~ C2[C3=='2008-12-06'])
plot(C1[C3=='2008-12-07'] ~ C2[C3=='2008-12-07'])
plot(C1[C3=='2008-12-08'] ~ C2[C3=='2008-12-08'])
plot(C1[C3=='2008-12-09'] ~ C2[C3=='2008-12-09'])

which gives the good curves but it is not as nice as with lattice.

Could you please tell me how to solve my problem ?
Thanks in advance,
Ptit Bleu.
 

-- 
View this message in context: http://www.nabble.com/xyplot-sorted-by-date-tp20936581p20936581.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list