[R] panel.linejoin groups

Erin Berryman berr0179 at umn.edu
Fri Sep 23 19:00:08 CEST 2005


Dear R community,

I am still new to R, but I am attempting to use it for (hopefully) all 
my plotting needs. I have been using lattice and Hmisc for most plots 
so far successfully, but I need help creating a plot I desire for some 
new data I have.
This data frame consists of the same type of measurement (Eh) for 27 
different locations. I have 8000+ measurements for each location, and 
my datalogger organizes the output like this:

Date					A1L			A2L			A3L	
2005-07-14 22:00		208.1		-178.5		196.8
2005-07-14 22:10		207.9		-184.3		200.0

Now I'm having trouble plotting A1L, A2L, A3L on the same plot as a 
function of Date. I thought I would try panel.linejoin, like so:

xyplot(data=redox2, A1L + A2L + A3L ~ Date, 
panel=function(x,y,...){panel.linejoin(x,y,horizontal=F,col=1,...)}, 
scales=list(x=list(tick.number=10)))	

But of course, what I get is the mean of the measurements from those 
three columns plotted as one line, when what I want is a separate line 
for each column of data. Do I need to define "groups" somehow to get 
separate lines? If so, how do I define groups based on membership in 
different columns? Or do I just need to reorganize my data to make it 
work, like this:

Date				Location		Eh
2005-07-14 22:00	A1L			208.1	
2005-07-14 22:00	A2L			-178.5

Then I can define groups=Location, and it would work.  But it would be 
good to know if I can make the data work as is - because I have many 
many more datasets that are structured this way.

Thank you,

Erin



Erin M. Berryman
Graduate Research Assistant
Department of Soil, Water, and Climate
University of Minnesota
439 Borlaug Hall
1991 Upper Buford Circle
St. Paul, MN 55104
612.625.9747
berr0179 at umn.edu




More information about the R-help mailing list