In fact subset(mydata, skill == 1)
is all that you need, unless skill is a factor, when subset(mydata, skill == "1") does the trick. More importantly, as a general rule, if you think you need to use '$' in connexion with subset(), transform(), with() or within(), you are most likelyu not really getting the point. These functions have a minor purpose of obviating the need to use things like '$'. Bill Venables http://www.cmis.csiro.au/bill.venables/ -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of milton ruser Sent: Monday, 30 March 2009 1:15 PM To: minben Cc: r-help@r-project.org Subject: Re: [R] A simple problem Suggestion of thread: "Selecting rows from dataframe" subset(mydata, mydata$skill==1") may works. Best wishes milton On Sun, Mar 29, 2009 at 10:27 PM, minben <minb...@gmail.com> wrote: > I am a new R user. Now I have some problem while I use R. I have set > up a data frame called "mydata". One of the colume of it was "skill". > Now I want to select the observations of the frame whose "skill" value > is 1,by what command can I get it? > > ______________________________________________ > 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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > [[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. ______________________________________________ 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.