# NOT RUN {
## use infert data
data(infert)
codebook(infert)
## DEMONSTRATION: KEEP
## suppose we want to keep education, age, induced and case
infert.new <- keep(infert, education, age, induced, case)
codebook(infert.new)
## use colon separator :
infert.new <- keep(infert, education:case)
codebook(infert.new)
## change the order of variables
infert.new <- keep(infert, stratum, pooled.stratum, education:spontaneous)
codebook(infert.new)
# }
Run the code above in your browser using DataLab