Reputation: 441
I'm working on cleaning a dataset I plan to use for analysis. Some records were coded as ''
instead of NA's, so I'm converting all these records to be NA and then dropping them from my dataset.
After dropping these records, the ''
factor group is still showing up in the summary of the data. Is there anyway to fix this?
Example Code:
surgery$gender[surgery$gender == ""] <- NA
surgery = surgery %>% drop_na(gender)
surgery$gender = as.factor(surgery$gender)
summary(surgery)
Example Summary Output:
Upvotes: 1
Views: 731