Thanks to everybody for the solutions.
On Tue, Jul 27, 2010 at 3:47 AM, Dennis Murphy wrote:
> Hi:
>
> Another approach might be to use the melt() function in package reshape
> before creating the plot with xyplot, something along the lines of the
> following:
>
> library(reshape)
> mdat <- melt(
One of the nice features of R's formula syntax is that
you can create a character string containing a formula,
and pass it to the formula() function. For example:
xyplot(formula(paste(paste(paste('D',1:10,sep=''),collapse='+'),'X',sep='~')),data)
will do what you want.
Hi:
Another approach might be to use the melt() function in package reshape
before creating the plot with xyplot, something along the lines of the
following:
library(reshape)
mdat <- melt(data, id = 'X')
This should create a data frame with three columns: X, variable (all the D*
names as factor
One method:
dd <- do.call(make.groups, mydata[,-1])
dd$X <- mydata$X
xyplot(data ~ X | which, dd)
Another method:
form <- paste(paste(colnames(mydata)[-1], collapse = " + "), "~ X")
xyplot(as.formula(form), mydata)
Yet another method:
library(latticeExtra)
xyplot.list(mydata[,-1], FUN = functi
4 matches
Mail list logo