SAS imports missing data as empty strings or strings with whitespaces only. This helper function can be used to
convert these values to NAs.
Arguments
- x
(
factororcharactervector)
values for which any missing values should be substituted.- empty
(
logical)
ifTRUEempty strings get replaced byNA.- whitespaces
(
logical)
ifTRUEthen strings made from whitespaces only get replaced withNA.