-4

I'm new to R and I'm trying to find all the missing values in my data set. I'm using R and I tried the is.na function and it didn't work. Missing entries in my dataset have a "?"

1 Answers1

0
df[df=="?"] <- NA

zimia
  • 930
  • 3
  • 16
  • Hey thanks for this. Tried that and nothing executed. Am I missing something? – user15161304 Feb 11 '21 at 07:24
  • Hey if you run this line, your df should now have NA instead of "?". Then you can use na.omit(df) to remove the rows that contain NAs or use replace_na to replace the NAs with anything else you want by column. df %>% tidyr::replace_na(list(column_name=0)) for example will replace NA with 0 in the column called "column_name" – zimia Feb 11 '21 at 07:27