Re: [R] Overlaying lattice graphs (continued)

2007-06-22 Thread Sébastien
Hi Deepayan, The following code creates a dummy dataset which has the same similar as my usual datasets. I did not try to implement the changes proposed by Hadley, hoping that a solution can be found using the original dataset. # My code # Creating dataset nPts-10# number

Re: [R] Overlaying lattice graphs (continued)

2007-06-22 Thread hadley wickham
Hi Sebastian, I think the following does what you want: library(ggplot2) names(mydata) - tolower(names(mydata)) obs - rename(subset(mydata, model==A, -predicted), c(observed = value)) obs$model - factor(observed) pred - rename(mydata[, -5], c(predicted = value)) all - rbind(obs, pred)

Re: [R] Overlaying lattice graphs (continued)

2007-06-22 Thread Deepayan Sarkar
On 6/22/07, Sébastien [EMAIL PROTECTED] wrote: Hi Deepayan, The following code creates a dummy dataset which has the same similar as my usual datasets. I did not try to implement the changes proposed by Hadley, hoping that a solution can be found using the original dataset. # My

Re: [R] Overlaying lattice graphs (continued)

2007-06-22 Thread Sébastien
Hadley, I have some troubles to run your code with ggplot version 0.4.1. Is the package ggplot2 mandatory ? Sebastien hadley wickham a écrit : Hi Sebastian, I think the following does what you want: library(ggplot2) names(mydata) - tolower(names(mydata)) obs - rename(subset(mydata,

Re: [R] Overlaying lattice graphs (continued)

2007-06-22 Thread hadley wickham
Yes - you'll need ggplot2. Hadley On 6/22/07, Sébastien [EMAIL PROTECTED] wrote: Hadley, I have some troubles to run your code with ggplot version 0.4.1. Is the package ggplot2 mandatory ? Sebastien hadley wickham a écrit : Hi Sebastian, I think the following does what you want:

Re: [R] Overlaying lattice graphs (continued)

2007-06-21 Thread hadley wickham
Hi Sebastian, I think you need to rearrange your data a bit. Firstly, you need to put observed on the same footing as the different models, so you would have a new column in your data called value (previously observed and predicted) and a new model type (observed). Then you could do:

Re: [R] Overlaying lattice graphs (continued)

2007-06-21 Thread Sébastien
Sorry, I have forgotten to tell that I work on R version 2.5.0 on Windows XP sp2. Sébastien a écrit : Dear R Users, I recently posted an email on this list about the use of data.frame and overlaying multiple plots. Deepayan kindly indicated to me the panel.superposition command which

Re: [R] Overlaying lattice graphs (continued)

2007-06-21 Thread Sébastien
Hi Hadley, Hopefully, my dataset won't be too hard to changed. Can I modify the aspect of each group using your code (symbols for observed and lines for predicted)? Sebastien hadley wickham a écrit : Hi Sebastian, I think you need to rearrange your data a bit. Firstly, you need to put

Re: [R] Overlaying lattice graphs (continued)

2007-06-21 Thread hadley wickham
Sebastian, You should be able to, but I don't know how to do it with lattice. In ggplot (http://had.co.nz/ggplot2) you would do it as follows: ggplot(mydata, aes(x = time, y = value, colour=model)) + geom_point(subset(data, model != observed)) + geom_line((subset(data, model == observed)) +

Re: [R] Overlaying lattice graphs (continued)

2007-06-21 Thread Deepayan Sarkar
On 6/21/07, Sébastien [EMAIL PROTECTED] wrote: Hi Hadley, Hopefully, my dataset won't be too hard to changed. Can I modify the aspect of each group using your code (symbols for observed and lines for predicted)? Sebastien hadley wickham a écrit : Hi Sebastian, I think you need to

[R] Overlaying lattice graphs (continued)

2007-06-20 Thread Sébastien
Dear R Users, I recently posted an email on this list about the use of data.frame and overlaying multiple plots. Deepayan kindly indicated to me the panel.superposition command which worked perfectly in the context of the example I gave. I'd like to go a little bit further on this topic using

Re: [R] Overlaying lattice graphs

2007-06-12 Thread Sébastien
Thanks for the information. These commands work perfectly fine and the ?panel.superpose help was most informative. If you don't mind, I will certainly come back to you as there will certainly be additionnal complexities in my datasets that I will be unable to handle (e.g. data in more than one

Re: [R] Overlaying lattice graphs

2007-06-12 Thread hadley wickham
On 6/12/07, Seb [EMAIL PROTECTED] wrote: Hello I apologize in advance if this question has already be posted on the list, although I could not find a relevant thread in the archives. I would like to overlay xyplots using different datasets for each plot. I typically work on the following

[R] Overlaying lattice graphs

2007-06-11 Thread Seb
Hello I apologize in advance if this question has already be posted on the list, although I could not find a relevant thread in the archives. I would like to overlay xyplots using different datasets for each plot. I typically work on the following data.frame (mydata) structure mydata

Re: [R] Overlaying lattice graphs

2007-06-11 Thread Deepayan Sarkar
On 6/11/07, Seb [EMAIL PROTECTED] wrote: Hello I apologize in advance if this question has already be posted on the list, although I could not find a relevant thread in the archives. I would like to overlay xyplots using different datasets for each plot. I typically work on the following