Subset function not removing NAs
10,830
Try x<-subset(df, is.na(Injured))
.
Author by
user1471980
Updated on June 17, 2022Comments
-
user1471980 almost 2 years
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?