# NOT RUN {
## use infert dataset
data(infert)
## replace parity == NA if parity > 4
tab(infert, parity)
infert.new <- replace(infert, parity, NA, parity > 4)
tab(infert.new, parity)
## replace education as character
infert.new <- replace(infert, education, as.character(education))
codebook(infert.new)
tab(infert.new, education)
# }
Run the code above in your browser using DataLab