See ?"[" and its examples Also, section 2.7 of An Introduction to R is a good place to start:
http://cran.r-project.org/doc/manuals/R-intro.html#Index-vectors hth, Kingsford Jones On Mon, Feb 9, 2009 at 5:27 PM, jjh21 <[email protected]> wrote: > > Hello, > > I am trying to do some data cleaning in R. I need to drop observations that > take on certain values of a variable. In STATA I might type something like: > > drop if <variable name> == 3 > drop if <variable name> == 4 > > Is there an R equivalent of this? I have tried playing around with the > subset command, but it seems a bit clunky. What would an advanced R user's > approach be for something like this? > > Thank you! > > > -- > View this message in context: > http://www.nabble.com/What-is-the-R-equivalent-of-STATA%27s-%27drop%27-command--tp21925249p21925249.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > [email protected] 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. > ______________________________________________ [email protected] 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.

