[R] Selection/filtering from Data

Jim Lemon drjimlemon at gmail.com
Mon Feb 16 09:41:41 CET 2015


Hi Parth,
Assume that your dataset is in the form of a data frame, named psdf.

psdf<-data.frame(age=sample(0:100,50),income=sample(8000:12000,50))
selectdf<-subset(psdf,age >= 36 & income > 10000)

Jim

On Mon, Feb 16, 2015 at 7:01 PM, Partha Sinha <pnsinha68 at gmail.com> wrote:
> >From a dataset , I want select age >=36 and income>10000. How to do ?
> parth
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list