0

I want to specify that a select column has no missing values. Any other column can have missing values except this one. The column I will call 'Iteration'. Here is my code:

df = na.omit(df, cols = "Iteration")

This is a column of strings (ex: different division names for my dataset).

This returns an empty dataframe for some reason. Can someone catch my mistake?

rmahesh
  • 739
  • 2
  • 14
  • 30
  • we would need to see `df`. Please include a minimal, reproducible example https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Melissa Key Jun 18 '18 at 18:15
  • 1
    `df <- df[complete.cases(df$Iteration),]` – IceCreamToucan Jun 18 '18 at 18:15
  • @Ryan This solution worked perfectly thank you so much! I am new to R so I think complete cases function is what I will be using to deal with missing values. – rmahesh Jun 18 '18 at 18:17

0 Answers0