From: Rohit Pandey <rohitpandey576_at_gmail.com>

Date: Wed, 16 Mar 2011 02:36:52 +0530

Date: Wed, 16 Mar 2011 02:36:52 +0530

I have two questions about using R.

list(matrix(1:6,ncol=2),matrix(1:6,ncol=2))->l1 l2<-list(1:3,2)

My second question is about the tapply function.

tapply(1:5,list(c(1,1,2,2,3),c(1,2,1,1,3)),sum) will give me:

1 2 3

1 1 2 NA

2 7 NA NA

3 NA NA 5

The index here is a list: list(c(1,1,2,2,3),c(1,2,1,1,3)).

Error in sort.list(y) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

Is there a way to use the above list in the tapply function?

-- Thanks, Rohit Mob: 91 9819926213 [[alternative HTML version deleted]] ______________________________________________ R-help_at_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.Received on Wed 16 Mar 2011 - 01:07:00 GMT

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Wed 16 Mar 2011 - 01:50:21 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*