Skip to content

A beginner's question

5 messages · minben, Coen van Hasselt, K. Elo +2 more

#
I am a new R-language user. I have set up a data frame "mydata",one of
the colume of which is "skill". Now I want to select the observations
whose "skill" value is equal to 1,by what command can I get it?
#
Here's an example:

mydata<-data.frame(skill=c(1,2,3,4),x=c(1,1,1,1))
mydata[mydata$skill==1,]
On Fri, Mar 27, 2009 at 16:40, minben <minbenh at gmail.com> wrote:
#
Hi,
minben wrote:
Try this:
mydata1<-mydatasubset(mydata, skill==1)

Maybe You should also read this introduction:
http://cran.r-project.org/doc/manuals/R-intro.pdf


Kind regards,
Kimmo
#
You can do like this:

1.
    mydata[mydata$skill==1,]

2. 
   mydata[mydata[,"skill"]==1,]
  
/Forin


On Thu, 26 Mar 2009 23:40:32 -0700 (PDT)
minben <minbenh at gmail.com> wrote:

            

  
    
#
minben schreef:
To add the number of possibilities :):

subset(mydata, skill == 1)

cheers,
Paul