[R] R-help,
Jean Eid
jeaneid at chass.utoronto.ca
Thu May 19 13:01:38 CEST 2005
I do not fully understand your example but if you need to act on the
columns of a dataframe why don't you just call its columns the title you
want. something like
X<-matrix(rnorm(1000), ncol=4)
colnames(X)<-c("foo", "foo1", "foo2", "foo3")
X<-as.data.frame(X)
par(mfrow=c(2,2))
lapply(colnames(X), function(x) plot(X[,x], ylab="y", xlab="x", main=x))
HTH
Jean
On Thu, 19 May 2005, Luis Ridao Cruz wrote:
> R-help,
>
> I usually call lapply to plot some dat frames structures.Something like
> this:
>
> par(mfrow=c(4,3),mar=c(2, 4, 2, 1) + 0.1)
> lapply(my.list , function(x)
> {
> plot(colnames(x) , apply(x,2,mean), type="o", pch = 16, ylab = "Index"
> , xlab = "")
> }
> )
>
> But it is difficult for me to put a title on every plot according to
> the list names.
> I guess the re other ways to do it but the structure above is so handy
> to me that I want to stick to it.
>
> Any suggestions?
>
>
> I run on Windows XP machine
>
> > version
> _
> platform i386-pc-mingw32
> arch i386
> os mingw32
> system i386, mingw32
> status
> major 2
> minor 1.0
> year 2005
> month 04
> day 18
> language R
>
>
> Thanks in advance
>
> ______________________________________________
> R-help at 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
>
More information about the R-help
mailing list