remove_all_labels: Remove value and variable labels from vector or data frame

Description Usage Arguments Value See Also Examples

View source: R/remove_all_labels.R

Description

This function removes value and variable label attributes from a vector or data frame. These attributes are typically added to variables when importing foreign data (see read_spss) or manually adding label attributes with set_labels.

Usage

1

Arguments

x

Vector or data.frame with variable and/or value label attributes

Value

x with removed value and variable label attributes.

See Also

See vignette Labelled Data and the sjlabelled-Package, and copy_labels for adding label attributes (subsetted) data frames.

Examples

1
2
3

Example output

'data.frame':	908 obs. of  26 variables:
 $ c12hour : atomic  16 148 70 168 168 16 161 110 28 40 ...
  ..- attr(*, "label")= chr "average number of hours of care per week"
 $ e15relat: atomic  2 2 1 1 2 2 1 4 2 2 ...
  ..- attr(*, "label")= chr "relationship to elder"
  ..- attr(*, "labels")= Named num  1 2 3 4 5 6 7 8
  .. ..- attr(*, "names")= chr  "spouse/partner" "child" "sibling" "daughter or son -in-law" ...
 $ e16sex  : atomic  2 2 2 2 2 2 1 2 2 2 ...
  ..- attr(*, "label")= chr "elder's gender"
  ..- attr(*, "labels")= Named num  1 2
  .. ..- attr(*, "names")= chr  "male" "female"
 $ e17age  : atomic  83 88 82 67 84 85 74 87 79 83 ...
  ..- attr(*, "label")= chr "elder' age"
 $ e42dep  : atomic  3 3 3 4 4 4 4 4 4 4 ...
  ..- attr(*, "label")= chr "elder's dependency"
  ..- attr(*, "labels")= Named num  1 2 3 4
  .. ..- attr(*, "names")= chr  "independent" "slightly dependent" "moderately dependent" "severely dependent"
 $ c82cop1 : atomic  3 3 2 4 3 2 4 3 3 3 ...
  ..- attr(*, "label")= chr "do you feel you cope well as caregiver?"
  ..- attr(*, "labels")= Named num  1 2 3 4
  .. ..- attr(*, "names")= chr  "never" "sometimes" "often" "always"
 $ c83cop2 : atomic  2 3 2 1 2 2 2 2 2 2 ...
  ..- attr(*, "label")= chr "do you find caregiving too demanding?"
  ..- attr(*, "labels")= Named num  1 2 3 4
  .. ..- attr(*, "names")= chr  "Never" "Sometimes" "Often" "Always"
 $ c84cop3 : atomic  2 3 1 3 1 3 4 2 3 1 ...
  ..- attr(*, "label")= chr "does caregiving cause difficulties in your relationship with your friends?"
  ..- attr(*, "labels")= Named num  1 2 3 4
  .. ..- attr(*, "names")= chr  "Never" "Sometimes" "Often" "Always"
 $ c85cop4 : atomic  2 3 4 1 2 3 1 1 2 2 ...
  ..- attr(*, "label")= chr "does caregiving have negative effect on your physical health?"
  ..- attr(*, "labels")= Named num  1 2 3 4
  .. ..- attr(*, "names")= chr  "Never" "Sometimes" "Often" "Always"
 $ c86cop5 : atomic  1 4 1 1 2 3 1 1 2 1 ...
  ..- attr(*, "label")= chr "does caregiving cause difficulties in your relationship with your family?"
  ..- attr(*, "labels")= Named num  1 2 3 4
  .. ..- attr(*, "names")= chr  "Never" "Sometimes" "Often" "Always"
 $ c87cop6 : atomic  1 1 1 1 2 2 2 1 1 1 ...
  ..- attr(*, "label")= chr "does caregiving cause financial difficulties?"
  ..- attr(*, "labels")= Named num  1 2 3 4
  .. ..- attr(*, "names")= chr  "Never" "Sometimes" "Often" "Always"
 $ c88cop7 : atomic  2 3 1 1 1 2 4 2 3 1 ...
  ..- attr(*, "label")= chr "do you feel trapped in your role as caregiver?"
  ..- attr(*, "labels")= Named num  1 2 3 4
  .. ..- attr(*, "names")= chr  "Never" "Sometimes" "Often" "Always"
 $ c89cop8 : atomic  3 2 4 2 4 1 1 3 1 1 ...
  ..- attr(*, "label")= chr "do you feel supported by friends/neighbours?"
  ..- attr(*, "labels")= Named num  1 2 3 4
  .. ..- attr(*, "names")= chr  "never" "sometimes" "often" "always"
 $ c90cop9 : atomic  3 2 3 4 4 1 4 3 3 3 ...
  ..- attr(*, "label")= chr "do you feel caregiving worthwhile?"
  ..- attr(*, "labels")= Named num  1 2 3 4
  .. ..- attr(*, "names")= chr  "never" "sometimes" "often" "always"
 $ c160age : atomic  56 54 80 69 47 56 61 67 59 49 ...
  ..- attr(*, "label")= chr "carer' age"
 $ c161sex : atomic  2 2 1 1 2 1 2 2 2 2 ...
  ..- attr(*, "label")= chr "carer's gender"
  ..- attr(*, "labels")= Named num  1 2
  .. ..- attr(*, "names")= chr  "Male" "Female"
 $ c172code: atomic  2 2 1 2 2 2 2 2 NA 2 ...
  ..- attr(*, "label")= chr "carer's level of education"
  ..- attr(*, "labels")= Named num  1 2 3
  .. ..- attr(*, "names")= chr  "low level of education" "intermediate level of education" "high level of education"
 $ c175empl: atomic  1 1 0 0 0 1 0 0 0 0 ...
  ..- attr(*, "label")= chr "are you currently employed?"
  ..- attr(*, "labels")= Named num  0 1
  .. ..- attr(*, "names")= chr  "no" "yes"
 $ barthtot: atomic  75 75 35 0 25 60 5 35 15 0 ...
  ..- attr(*, "label")= chr "Total score BARTHEL INDEX"
 $ neg_c_7 : atomic  12 20 11 10 12 19 15 11 15 10 ...
  ..- attr(*, "label")= chr "Negative impact with 7 items"
 $ pos_v_4 : atomic  12 11 13 15 15 9 13 14 13 13 ...
  ..- attr(*, "label")= chr "Positive value with 4 items"
 $ quol_5  : atomic  14 10 7 12 19 8 20 20 8 15 ...
  ..- attr(*, "label")= chr "Quality of life 5 items"
 $ resttotn: atomic  0 4 0 2 2 1 0 0 0 1 ...
  ..- attr(*, "label")= chr "Job restrictions"
 $ tot_sc_e: atomic  4 0 1 0 1 3 0 1 2 1 ...
  ..- attr(*, "label")= chr "Services for elderly"
 $ n4pstu  : atomic  0 0 2 3 2 2 3 1 3 3 ...
  ..- attr(*, "label")= chr "Care level"
  ..- attr(*, "labels")= Named chr  "0" "1" "2" "3" ...
  .. ..- attr(*, "names")= chr  "No Care Level" "Care Level 1" "Care Level 2" "Care Level 3" ...
 $ nur_pst : atomic  NA NA 2 3 2 2 3 1 3 3 ...
  ..- attr(*, "label")= chr "Care level"
  ..- attr(*, "labels")= Named chr  "1" "2" "3"
  .. ..- attr(*, "names")= chr  "Care Level 1" "Care Level 2" "Care Level 3/3+"
Classes 'tbl_df', 'tbl' and 'data.frame':	908 obs. of  26 variables:
 $ c12hour : num  16 148 70 168 168 16 161 110 28 40 ...
 $ e15relat: num  2 2 1 1 2 2 1 4 2 2 ...
 $ e16sex  : num  2 2 2 2 2 2 1 2 2 2 ...
 $ e17age  : num  83 88 82 67 84 85 74 87 79 83 ...
 $ e42dep  : num  3 3 3 4 4 4 4 4 4 4 ...
 $ c82cop1 : num  3 3 2 4 3 2 4 3 3 3 ...
 $ c83cop2 : num  2 3 2 1 2 2 2 2 2 2 ...
 $ c84cop3 : num  2 3 1 3 1 3 4 2 3 1 ...
 $ c85cop4 : num  2 3 4 1 2 3 1 1 2 2 ...
 $ c86cop5 : num  1 4 1 1 2 3 1 1 2 1 ...
 $ c87cop6 : num  1 1 1 1 2 2 2 1 1 1 ...
 $ c88cop7 : num  2 3 1 1 1 2 4 2 3 1 ...
 $ c89cop8 : num  3 2 4 2 4 1 1 3 1 1 ...
 $ c90cop9 : num  3 2 3 4 4 1 4 3 3 3 ...
 $ c160age : num  56 54 80 69 47 56 61 67 59 49 ...
 $ c161sex : num  2 2 1 1 2 1 2 2 2 2 ...
 $ c172code: num  2 2 1 2 2 2 2 2 NA 2 ...
 $ c175empl: num  1 1 0 0 0 1 0 0 0 0 ...
 $ barthtot: num  75 75 35 0 25 60 5 35 15 0 ...
 $ neg_c_7 : num  12 20 11 10 12 19 15 11 15 10 ...
 $ pos_v_4 : num  12 11 13 15 15 9 13 14 13 13 ...
 $ quol_5  : num  14 10 7 12 19 8 20 20 8 15 ...
 $ resttotn: num  0 4 0 2 2 1 0 0 0 1 ...
 $ tot_sc_e: num  4 0 1 0 1 3 0 1 2 1 ...
 $ n4pstu  : num  0 0 2 3 2 2 3 1 3 3 ...
 $ nur_pst : num  NA NA 2 3 2 2 3 1 3 3 ...

sjlabelled documentation built on May 11, 2021, 5:08 p.m.