On Thu, Jun 26, 2008 at 12:14 AM, Wacek Kusnierczyk <
[EMAIL PROTECTED]> wrote:

> >
> >     sapply(dats,function(x){sapply(x,min)})
>
> you can achieve the same with
>
> sapply(dats, sapply, min)
>
>
Did you actually try it?

> dats <- data.frame(1:10,2:11)
> sapply(dats,sapply,min)
      X1.10 X2.11
 [1,]     1     2
 [2,]     2     3
 [3,]     3     4
 [4,]     4     5
 [5,]     5     6
 [6,]     6     7
 [7,]     7     8
 [8,]     8     9
 [9,]     9    10
[10,]    10    11

Sapply doesn't (or can't?) pass arguments to another sapply -- maybe  the
trick can be done without an anonymous function but not the way you
suggested.

Kenn

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to