Hi everyone, I'd like to know how to delete from a dataset some rows that have empty cells (""). Though I've already wrote the formula complete.cases, some of them still remains.
For instance, Ever_married instead of having "yes" and "no" has also "".
Thank you in advance!
It would be most useful if you can provide a reproducible example (reprex) and not a screenshot. Share the results of dput(head(dataframename, 20))
is one way to do this. Here's some more info about making a reprex: FAQ: What's a reproducible example (`reprex`) and how do I create one?
As to your question, I think Ever_Married has values of "" and not NA. To remove these, there's a few options. Here's one:
library(tidyverse)
newdata <- data %>%
filter(Ever_Married!="")
1 Like
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.