# NOT RUN {
Character <- c(NA,letters[1:3], NA)
Factor <- factor(Character)
Ordered <- ordered(Factor)
Numeric <- rep(1, length(Factor))
Factor_without_NA <- factor(letters[1:length(Factor)])
DD <- data.frame(Character, Factor, Ordered,
Numeric, Factor_without_NA,
stringsAsFactors = FALSE)
# }
# NOT RUN {
DD2 <- replace_NA(DD, replacement = 'no value')
summary(DD)
summary(DD2) # now with 'no value' instead NA in column Character, Factor and Ordered
atable_options(replace_NA_by = 'not measured') # use atable_options to set replacement
DD3 <- replace_NA(DD)
summary(DD3) # now with 'not measured' instead NA
atable_options_reset() # set 'replace_NA_by' back to default
# }
Run the code above in your browser using DataCamp Workspace