Re: [R] panel.linejoin groups

2005-09-23 Thread Deepayan Sarkar
On 9/23/05, Erin Berryman <[EMAIL PROTECTED]> wrote:
> Both methods you listed do work, but type='l' is what I want, thank you
> for pointing that out to me. Incidentally, xyplot(type='l') printed
> much faster on the display than the panel.groups=() method.

Not surprising if you have many values of 'Date', since panel.linejoin
will try to compute the mean (of a length-1 vector) for each
combination of Date and groups.

Deepayan

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] panel.linejoin groups

2005-09-23 Thread Erin Berryman
Both methods you listed do work, but type='l' is what I want, thank you 
for pointing that out to me. Incidentally, xyplot(type='l') printed 
much faster on the display than the panel.groups=() method. I was 
captivated by linejoin before I ever had a case to use 
xyplot(type='l'), which would explain why I tried to use it for this 
type of plot!


On Sep 23, 2005, at 1:01 PM, Deepayan Sarkar wrote:

> On 9/23/05, Erin Berryman <[EMAIL PROTECTED]> wrote:
>> 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:
>>
>> DateA1L A2L   
>>   A3L
>> 2005-07-14 22:00208.1   -178.5  196.8
>> 2005-07-14 22:10207.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:
>>
>> DateLocationEh
>> 2005-07-14 22:00A1L 208.1
>> 2005-07-14 22:00A2L -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.
>
> Yes, simply supply 'panel.groups' instead of 'panel'
>
> panel.groups = function(x,y,...) { 
> panel.linejoin(x,y,horizontal=F,col=1,...) },
>
> panel.linejoin doesn't know anything about groups, and has to be used
> through panel.superpose (which does). However, the more obvious
> approach seems to be
>
> xyplot(A1L + A2L + A3L ~ Date, data=redox2,
>type = 'l',
>scales=list(x=list(tick.number=10)))
>
> Does that not work? panel.linejoin is meant for cases where several
> observations need to be summarized by a single number (mean, median,
> etc).
>
> BTW, it's not a good idea to have anything other than the formula as
> the first argument to xyplot etc.
>
> Deepayan
>
Erin M. Berryman
Graduate Research Assistant
Department of Soil, Water, and Climate
University of Minnesota
612.625.9747

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] panel.linejoin groups

2005-09-23 Thread Deepayan Sarkar
On 9/23/05, Erin Berryman <[EMAIL PROTECTED]> wrote:
> 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:
>
> DateA1L A2L   
>   A3L
> 2005-07-14 22:00208.1   -178.5  196.8
> 2005-07-14 22:10207.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:
>
> DateLocationEh
> 2005-07-14 22:00A1L 208.1
> 2005-07-14 22:00A2L -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.

Yes, simply supply 'panel.groups' instead of 'panel'

panel.groups = function(x,y,...) { panel.linejoin(x,y,horizontal=F,col=1,...) },

panel.linejoin doesn't know anything about groups, and has to be used
through panel.superpose (which does). However, the more obvious
approach seems to be

xyplot(A1L + A2L + A3L ~ Date, data=redox2,
   type = 'l',
   scales=list(x=list(tick.number=10)))

Does that not work? panel.linejoin is meant for cases where several
observations need to be summarized by a single number (mean, median,
etc).

BTW, it's not a good idea to have anything other than the formula as
the first argument to xyplot etc.

Deepayan

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] panel.linejoin groups

2005-09-23 Thread Erin Berryman
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:

DateA1L A2L 
A3L 
2005-07-14 22:00208.1   -178.5  196.8
2005-07-14 22:10207.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:

DateLocationEh
2005-07-14 22:00A1L 208.1   
2005-07-14 22:00A2L -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
[EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html