[R] applying complex functions by groups

From: Finch, W. Holmes <whfinch_at_bsu.edu>
Date: Mon, 14 Jul 2008 10:39:52 -0400


Hi,

I have a matrix that is indexed by groups and looks something like this:

1 1 2
1 2 1
.
.
.

2 1 1
2 1 2
2 NA 1
.
.
.

3 1 NA
3 2 NA
etc.

The first column is the group variable and I would like to apply categorical data imputation functions to the other two columns, doing so by groups. I have tried APPLY, BY and SPLIT, but have not had much luck getting it to work. I wonder if anyone has suggestions for how I might do this kind of by groups processing. Thanks very much.

Holmes

Holmes Finch
Associate Professor
Director of Research, Office of Charter School Research Department of Educational Psychology
Ball State University
Muncie, IN 47306
(765) 285-3668

My favorite quote:

"I was gently accused of escapism during a TV interview about a book I had written on my length-of-California walk. Frankly, I fail to see how going for a six-month, thousand-mile walk through deserts and mountains can be judged less real than spending six months working eight hours a day, five days a week, in order to earn enough money to be able to come back home to a comfortable home in the evening and sit in front of a TV screen and watch the two-dimensional image of some guy talking about a book he has written on a six-month, thousand-mile walk through deserts and mountains."

Colin Fletcher (1922-2007), renowned hiker and outdoor writer



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 Mon 14 Jul 2008 - 14:46:14 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 Mon 14 Jul 2008 - 17:31: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.

list of date sections of archive