I have another question, if I now want to remove multiple id's e.g. id=1 or 4 is there a simple OR command I can use?
I triedĀ d2<-(d1[id != 1 | 4, ]) however this does not delete anything PSĀ d2<-(d1[id != 4, ]) worked to remove id=4 Thanks Gina --- On Thu, 4/2/09, hadley wickham <h.wick...@gmail.com> wrote: From: hadley wickham <h.wick...@gmail.com> Subject: Re: [R] Deleting rows based on identity variable To: "Rowe, Brian Lee Yung (Portfolio Analytics)" <b_r...@ml.com> Cc: "gina patel" <ginapatel1...@yahoo.com>, R-help@r-project.org Date: Thursday, April 2, 2009, 4:48 PM On Thu, Apr 2, 2009 at 3:37 PM, Rowe, Brian Lee Yung (Portfolio Analytics) <b_r...@ml.com> wrote: > Is this what you want: >> d1[which(id != 4),] Or just d1[id != 4, ] Hadley -- http://had.co.nz/ [[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.