SAS imports missing data as empty strings or strings with whitespaces only. This helper function can be used to
convert these values to NA
s.
Arguments
- x
(
factor
orcharacter
)
values for which any missing values should be substituted.- empty
(
flag
)
ifTRUE
, empty strings get replaced byNA
.- whitespaces
(
flag
)
ifTRUE
, strings made from only whitespaces get replaced withNA
.