Replace uninformative strings (eg. empty strings like '') in the data frame with NAs, so they can be removed as missing values. By default, empty strings will be replaced. If 'rmvsym' is set to 'True', strings containing only symbols will also be replaced. If 'format' is set with a regular expression, the function will replace all the strings of non-compliant formats with NAs.
repwithna(df, rmvsym = FALSE, format = NULL)
df | the input data frame |
---|---|
rmvsym | The default value is False. If True, remove all the strings containing only symbols |
format | A regular expression representing the format of the string value in the data frame |
data frame
#> Name Age #> 1 <NA> 21 #> 2 <NA> 15