Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-12 Thread Jeff Stevens
Hi Deepayan Many thanks for bringing the which.packet() function to my attention--I missed it in the book. I do prefer that the panel function applies the labels to the data rather than adding them directly to the data in advance. Jeff On Tue, Apr 12, 2011 at 8:50 AM, Deepayan Sarkar wrote: >

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-11 Thread Deepayan Sarkar
On Mon, Apr 11, 2011 at 12:49 AM, Jeff Stevens wrote: > Many thanks, Peter.  This works brilliantly, and I prefer to have the > labels assigned outside of panel function as well. You could also consider using which.packet(). You haven't explicitly told us how the labels are matched with the boxpl

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-10 Thread Jeff Stevens
Many thanks, Peter. This works brilliantly, and I prefer to have the labels assigned outside of panel function as well. Cheers, Jeff On Sun, Apr 10, 2011 at 5:18 PM, Peter Ehlers wrote: > On 2011-04-10 04:50, Jeff Stevens wrote: >> >> Hi Peter, >> >> Thanks for the solutions.  The only problem

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-10 Thread Peter Ehlers
On 2011-04-10 12:19, Jeff Stevens wrote: Many thanks, Peter. This works brilliantly, and I prefer to have the labels assigned outside of panel function as well. Cheers, Jeff Small add-on: It's probably best to ensure that the labels are of type character, not factor. Peter [...snip...] ___

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-10 Thread Peter Ehlers
On 2011-04-10 04:50, Jeff Stevens wrote: Hi Peter, Thanks for the solutions. The only problem now is that I have duplicate values in my labels that are removed by the duplicated function. Perhaps a better example of the labels vector would be: lab<- c(1,2,4,4,6,6) Your first version would mai

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-10 Thread Jeff Stevens
Hi Peter, Thanks for the solutions. The only problem now is that I have duplicate values in my labels that are removed by the duplicated function. Perhaps a better example of the labels vector would be: lab <- c(1,2,4,4,6,6) Your first version would maintain the second 4 (because they are in di

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-09 Thread Jeff Stevens
Hi, Thanks for the work around, Dennis. My actual data set has 64 replicates for each factor level combination (rather than the 3 in the example), so the overplotting is quite messy. Any ideas on how to avoid the overplotting? Jeff On Fri, Apr 8, 2011 at 7:32 PM, Dennis Murphy wrote: > Hi: >

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-09 Thread Peter Ehlers
On 2011-04-09 06:21, Dennis Murphy wrote: Hi: One hopes that there is a more elegant solution than this bit of ad-hockery. From your posted example: f1<- c(rep(c(rep("a", 3), rep("b", 3), rep("c", 3)), 2)) f2<- c(rep("A", 9), rep("B", 9)) dv<- c(0.9, 0.8, 0.85, 0.6, 0.65, 0.7, 0.8, 0.85, 0.8,

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-09 Thread Dennis Murphy
Hi: One hopes that there is a more elegant solution than this bit of ad-hockery. >From your posted example: f1 <- c(rep(c(rep("a", 3), rep("b", 3), rep("c", 3)), 2)) f2 <- c(rep("A", 9), rep("B", 9)) dv <- c(0.9, 0.8, 0.85, 0.6, 0.65, 0.7, 0.8, 0.85, 0.8, 0.95, 0.85, 0.9, 0.65, 0.7, 0.75, 0.85,

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-08 Thread Dennis Murphy
Hi: After a number of false starts, I finally consulted Deepayan's book and the example on p. 73, suitably adapted, yielded a solution. Add a variable for the labels and then... df$lab <- rep(1:6, each = 3) bwplot(dv ~ f1 | f2, data = df, ylim = c(0.5, 1), panel = function(x, y, ..., subscripts)