Re: [R] trellis plot

2012-03-26 Thread Peter Ehlers
On 2012-03-26 09:09, Sebastián Daza wrote: Thank you Peter. The problem with you solution is that it doesn't represent the actual values of disruption. Look this example: person<- rep(1:2, each=4) income<- c(100, 120, 150, 200, 90, 100,120, 150) disruption<- c(0,0,0,1,0,1,1,0) time<- rep(c(1:4),

Re: [R] trellis plot

2012-03-26 Thread Sebastián Daza
Thank you Peter. The problem with you solution is that it doesn't represent the actual values of disruption. Look this example: person  <- rep(1:2, each=4) income  <- c(100, 120, 150, 200, 90, 100,120, 150) disruption  <- c(0,0,0,1,0,1,1,0) time  <- rep(c(1:4),2) dat  <- as.data.frame(cbind(person

Re: [R] trellis plot

2012-03-26 Thread Peter Ehlers
On 2012-03-25 21:20, Sebastián Daza wrote: Hi everyone, I am just trying to figure out how to do a xyplot where in addition to dots and lines I can change dots' colors according to an individual variable (e.g., marital disruption across time, a dummy 0/1). When I use "groups" specification (see

[R] trellis plot

2012-03-25 Thread Sebastián Daza
Hi everyone, I am just trying to figure out how to do a xyplot where in addition to dots and lines I can change dots' colors according to an individual variable (e.g., marital disruption across time, a dummy 0/1). When I use "groups" specification (see below), I get two different lines for each in

Re: [R] Trellis Plot

2009-11-24 Thread ychu066
i was trying to do a for loop for plotting the histograms , but it doesnt work properly > library(lattice) > columns <- 8:153 > plots <- vector("list", length(columns)) > j <- 0 > for (i in columns) + { + plots[[ j <- j+1 ]] <- histogram( ~ data[,i] | data[,2],ylab = "Frequency", +

Re: [R] Trellis Plot

2009-11-24 Thread Walmes Zeviani
You could try adapt this code: yy <- c(rnorm(20,2),rnorm(35,3), rnorm(30,2),rnorm(20,3),rnorm(4,2),rnorm(10,3)) xx <- c(1:20,1:35,1:30,1:20,1:4,1:10) gg <- rep(c('A','B','A','B','A','B'), c(20,35,30,20,4,10)) pp <- rep(c('Cond 1','Cond 2','Cond 3'), c(55, 50, 14)) #pdf("teste.pdf") xyplot(yy ~ x

Re: [R] Trellis Plot

2009-11-24 Thread Paul Hiemstra
ychu066 wrote: anyone know how to add text in the Trellis plot panel ?? i want to add things eg: dot dot dot. in the headrer of the panel. eg: http://old.nabble.com/file/p26486579/hist1.png hist1.png see panel.text() cheers, Paul -- Drs. Paul Hiemstra Department of Physical Geography Fac

[R] Trellis Plot

2009-11-23 Thread ychu066
anyone know how to add text in the Trellis plot panel ?? i want to add things eg: dot dot dot. in the headrer of the panel. eg: http://old.nabble.com/file/p26486579/hist1.png hist1.png -- View this message in context: http://old.nabble.com/Trellis-Plot-tp26486579p26486579.html Sent from the R