I have a data frame like this:
df
Date Player Injured
1/2/2012 A No
1/3/2012 B Yes
1/4/2012 C No
1/5/2012 B NA
1/5/2012 A No
1/7/2012 B Yes
1/8/2012 A No
1/3/2012 B Yes
1/2/2012 D No
1/3/2012 F NA
I am trying to use subset function to select players that injury info is NA:
x <- subset(df, injured!="NA")
x data frame is not populating. It seems very straightforward. Any ideas what I am doing wrong here?
Try
x<-subset(df, is.na(Injured)).