Re: [R] passing arguments to FUN in lapply

From: Adaikalavan Ramasamy <ramasamy_at_cancer.org.uk>
Date: Sat 19 Mar 2005 - 00:29:03 EST

See Andy Liaw's and my suggestion to this post http://files.protsuggest.org/biocond/html/7818.html

On Fri, 2005-03-18 at 11:40 +0000, Pingping Zheng wrote:
> Suppose I have a nx2 matrix of data, X, the following code generate
> density estimation for each column and plot them
>
> denlist <- apply(X, 2, density)
> par(mfrow=c(1,2))
> lapply(denlist, plot)
>
> Does anyone know how to change the main title of each density plot
> to "var 1", "var 2" by passing optional argument "main"? I've tried
>
> lapply(denlist, plot, main=c("var 1", "var 2"))
> which generates two same titles "var 1/var 2" and "var 1/var 2"
>
> lapply(denlist, plot, main=list("var 1", "var 2"))
> which generates two same titles "var 1"
>
> Both are not I want.
>



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 Received on Sat Mar 19 00:34:56 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:51 EST