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
vector)
values for which any missing values should be substituted.- empty
(
logical
)
ifTRUE
empty strings get replaced byNA
.- whitespaces
(
logical
)
ifTRUE
then strings made from whitespaces only get replaced withNA
.