Re: [R] panel function question

2008-03-28 Thread Deepayan Sarkar
On 3/27/08, Weidong Gu [EMAIL PROTECTED] wrote:
 I have two data sets with locations, X, Y of houses (df.house) and
  habitats(df.habitat), respectively. In each dataset, there are 3
  replicates (Repeat). Because each replicate has different locations of
  houses and habitats, I would like to plot them in panels. I wrote
  something like this:



  mypanel-function(x,y,subscripts,...){

   panel.xyplot(x,y,pch=20)

  panel.xyplot( df.habitat$X[subscripts], df.habitat$Y[subscripts], pch=3)

   }



  with(df.house, xyplot(X~Y|Repeat, panel=mypanel, subscripts=T))



  But the problem is that all habitats from 3 replicates are ended in one
  panel.



  Any help would be appreciated.

A reproducible example would have helped; I don't think I understand
what exactly you want to produce. As a general rule though, it's
usually easier to do things if you have a single data frame, which in
this case might be produced by

combined - make.groups(df.house, df.habitat)

This will have a new variable called 'which' indicating the source,
and you could use this variable in your call.

-Deepayan

__
R-help@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.


[R] panel function question

2008-03-27 Thread Weidong Gu
I have two data sets with locations, X, Y of houses (df.house) and
habitats(df.habitat), respectively. In each dataset, there are 3
replicates (Repeat). Because each replicate has different locations of
houses and habitats, I would like to plot them in panels. I wrote
something like this: 

 

mypanel-function(x,y,subscripts,...){

 panel.xyplot(x,y,pch=20)

panel.xyplot( df.habitat$X[subscripts], df.habitat$Y[subscripts], pch=3)

 }

 

with(df.house, xyplot(X~Y|Repeat, panel=mypanel, subscripts=T))

 

But the problem is that all habitats from 3 replicates are ended in one
panel. 

 

Any help would be appreciated.

 

Weidong Gu

Department of Medicine
University of Alabama, Birmingham
1900 University Blvd., Birmingham, Alabama 35294



 


[[alternative HTML version deleted]]

__
R-help@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.