Re: [R] Matrix as input to xyplot {lattice} - proper extended formula syntax

2009-09-06 Thread Gabor Grothendieck
For the example df below this also works: library(lattice); library(zoo) xyplot(zoo(df[1:4], df$x), type = p) On Sun, Sep 6, 2009 at 12:51 AM, David Winsemiusdwinsem...@comcast.net wrote: I'm not exactly sure what structure df has. Here's my effort to duplicate it: df -

Re: [R] Matrix as input to xyplot {lattice} - proper extended formula syntax

2009-09-06 Thread Deepayan Sarkar
On Sat, Sep 5, 2009 at 10:43 PM, Bryan Hansonhan...@depauw.edu wrote: Thanks David, your way of constructing df is much more compact than what I was using, so I've incorporated it.  I also had my rows and columns transposed relative to how xyplot wanted them (though I had tested for that,

Re: [R] Matrix as input to xyplot {lattice} - proper extended formula syntax

2009-09-06 Thread David Winsemius
On Sep 6, 2009, at 12:51 AM, David Winsemius wrote: I'm not exactly sure what structure df has. Here's my effort to duplicate it: df - data.frame(y=matrix(rnorm(24), nrow=6), x=1:6) df y.1y.2y.3y.4 x 1 0.1734636 0.2348417 -1.2375648 -1.3246439 1 2

[R] Matrix as input to xyplot {lattice} - proper extended formula syntax

2009-09-05 Thread Bryan Hanson
Hello R Folks... I have a list with the following structure: str(df) List of 3 $ y: num [1:4, 1:1242] -0.005379 0.029874 -0.023274 0.000655 -0.004537 .. $ x: num [1:1242] 501 503 505 507 509 ... $ names: Factor w/ 4 levels PC Loading 1,..: 1 2 3 4 I want to plot each row of df$y

Re: [R] Matrix as input to xyplot {lattice} - proper extended formula syntax

2009-09-05 Thread David Winsemius
I'm not exactly sure what structure df has. Here's my effort to duplicate it: df - data.frame(y=matrix(rnorm(24), nrow=6), x=1:6) df y.1y.2y.3y.4 x 1 0.1734636 0.2348417 -1.2375648 -1.3246439 1 2 1.9551669 -1.1027262 -0.7307332 0.3953752 2 3 -0.7645778

Re: [R] Matrix as input to xyplot {lattice} - proper extended formula syntax

2009-09-05 Thread Bryan Hanson
Thanks David, your way of constructing df is much more compact than what I was using, so I've incorporated it. I also had my rows and columns transposed relative to how xyplot wanted them (though I had tested for that, other problems interfered). In my case, I may have varying numbers of y