var_copy {surveytable} | R Documentation |
Copy a variable
Description
Create a new variable that is a copy of another variable. You can modify the copy, while the original remains unchanged. See examples.
Usage
var_copy(newvr, vr)
Arguments
newvr |
name of the new variable to be created |
vr |
variable |
Value
Survey object
See Also
Other variables:
var_all()
,
var_any()
,
var_case()
,
var_collapse()
,
var_cross()
,
var_cut()
,
var_not()
Examples
set_survey(namcs2019sv)
var_copy("Age group", "AGER")
var_collapse("Age group", "65+", c("65-74 years", "75 years and over"))
var_collapse("Age group", "25-64", c("25-44 years", "45-64 years"))
tab("AGER", "Age group")
[Package surveytable version 0.9.4 Index]