On Tuesday 19 April 2005 02:19, Adam Lyon wrote: > Hi, > > I am trying to do a simple superimposing of two density plots and am > seeing strange behavior (I haven't seen this reported elsewhere). > This little snipit will make it apparent... > > a = rnorm(10) > b = rnorm(100, mean=-2, sd=0.5) > densityplot( ~ a + b)
I'm not sure if this is explicitly documented anywhere (perhaps not), but the variables in the formula have to have the same length. What you should really do is densityplot(~ c(a, b), groups = rep(c('a', 'b'), c(10, 100)) Your usage should have triggered an error; I'll see if I can make that happen. Deepayan ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html