[R] Fwd: select a subset

From: gallon li <gallon.li_at_gmail.com>
Date: Tue, 25 Nov 2008 15:45:07 +0800

I am sorry but my question is not solvable by using subset alone.

You see, the selection criterion is different for different id. This may not be easily specified in the subset function.

Yes, I did think about this function before but couldn't find ways to use it.

  On Mon, Nov 24, 2008 at 8:42 PM, Stefan Grosse <singularitaet_at_gmx.net>wrote:

> gallon li schrieb:
> > for id 1, i want to select the last row since all censor indicator is 0;
> for
> > id 2, i want to select the row where censor ==1; for id 3, i also want to
> > select the row where censor==1. So if there is a 1 for censor, then I
> want
> > to select such a row, otherwise I want to select the last obs. for this
> id.
> > I am wondering if there is a quick way to solve this?
> >
> ?subset
> and please do read an introductionary text....

        [[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 Tue 25 Nov 2008 - 07:47:22 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 Tue 25 Nov 2008 - 14:00:28 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