Remove label attributes from a data frame or labelled vector
Source:R/lbl_helpers.R
zap_ipums_attributes.Rd
Remove all label attributes (value labels, variable labels, and variable descriptions) from a data frame or vector.
Arguments
- x
A data frame or labelled vector (for instance, from a data frame column)
See also
Other lbl_helpers:
lbl()
,
lbl_add()
,
lbl_clean()
,
lbl_define()
,
lbl_na_if()
,
lbl_relabel()
Examples
cps <- read_ipums_micro(ipums_example("cps_00157.xml"))
#> Use of data from IPUMS CPS is subject to conditions including that users should cite the data appropriately. Use command `ipums_conditions()` for more details.
attributes(cps$YEAR)
#> $label
#> [1] "Survey year"
#>
#> $var_desc
#> [1] "YEAR reports the year in which the survey was conducted. YEARP is repeated on person records."
#>
attributes(zap_ipums_attributes(cps$YEAR))
#> NULL
cps <- zap_ipums_attributes(cps)
attributes(cps$YEAR)
#> NULL
attributes(cps$INCTOT)
#> NULL