CodePudding user response:
Based on the screenshot, I would assume that the cells with missing values are empty strings and not NA values - and therefore aren't treated as 'missing'. You need to convert them:
cyclist_202105[cyclist_202105==""]<-NA
Another way is to handle this issue directly when importing the data via read.table()
by setting the parameter na.strings=
"" for direct conversion.
Next time please don't link screenshots but provide any code and datasets directly as formatted text.