Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(labelled)
  > test_check("labelled")
  ── 1. Failure: labelled return an object of class labelled (@test-labelled.r#6) 
  class(x) not equal to "labelled".
  1/1 mismatches
  x[1]: "haven_labelled"
  y[1]: "labelled"
  
  ── 2. Failure: labelled preserves variable label (@test-labelled.r#27)  ────────
  attr(x, "label", exact = TRUE) not equal to "test".
  target is NULL, current is character
  
  ── 3. Failure: val_labels preserves variable label (@test-labelled.r#36)  ──────
  attr(x, "label", exact = TRUE) not equal to "test".
  target is NULL, current is character
  
  ── 4. Failure: val_labels preserves variable label (@test-labelled.r#39)  ──────
  attr(x, "label", exact = TRUE) not equal to "test".
  target is NULL, current is character
  
  ── 5. Failure: val_label preserves variable label (@test-labelled.r#46)  ───────
  attr(x, "label", exact = TRUE) not equal to "test".
  target is NULL, current is character
  
  ── 6. Error: val_label preserves variable label (@test-labelled.r#48)  ─────────
  no applicable method for 'val_label<-' applied to an object of class "haven_labelled"
  1: `val_label<-`(`*tmp*`, 1, value = NULL) at testthat/test-labelled.r:48
  
  ── 7. Error: val_labels and val_label preserves spss missing values (@test-label
  no applicable method for 'val_label<-' applied to an object of class "c('haven_labelled_spss', 'haven_labelled')"
  1: `val_label<-`(`*tmp*`, 2, value = "maybe") at testthat/test-labelled.r:55
  
  ── 8. Failure: value labels can't be removed if missing values are defined (@tes
  ``val_labels<-`(x, NULL)` did not throw an error.
  
  ── 9. Failure: remove_labels strips labelled attributes (@test-labelled.r#83)  ─
  remove_labels(var) not equal to `exp`.
  Attributes: < Modes: list, NULL >
  Attributes: < Lengths: 2, 0 >
  Attributes: < names for target but not for current >
  Attributes: < current is not list-like >
  target is haven_labelled, current is numeric
  
  ── 10. Failure: to_character produce an appropriate character vector (@test-labe
  to_character(x) not equal to c("yes", "yes", "no").
  3/3 mismatches
  x[1]: "1"
  y[1]: "yes"
  
  x[2]: "1"
  y[2]: "yes"
  
  x[3]: "2"
  y[3]: "no"
  
  ── 11. Failure: to_labelled.factor preserves labelled character vectors (@test-l
  `s1` not equal to to_labelled(to_factor(s1), val_labels(s1)).
  Modes: character, numeric
  Attributes: < Component "labels": Modes: character, numeric >
  Attributes: < Component "labels": Names: 2 string mismatches >
  Attributes: < Component "labels": target is character, current is numeric >
  3 string mismatches
  
  ── 12. Failure: to_labelled.factor preserves labelled numerical vectors (@test-l
  `s2` not equal to to_labelled(to_factor(s2), val_labels(s2)).
  Attributes: < Component "labels": Names: 2 string mismatches >
  
  ── 13. Failure: set_value_labels replaces all value labels (@test-labelled.r#154
  val_labels(df$s1) not equal to c(Male = "M", Female = "F").
  target is NULL, current is character
  
  ── 14. Failure: set_value_labels replaces all value labels (@test-labelled.r#155
  val_labels(df$s2) not equal to c(Yes = 1, No = 2).
  target is NULL, current is numeric
  
  ── 15. Failure: set_value_labels replaces all value labels (@test-labelled.r#157
  val_labels(df$s2) not equal to c(Yes = 1, Unknown = 9).
  target is NULL, current is numeric
  
  ── 16. Error: add_value_labels and remove_value_labels updates the list of value
  no applicable method for 'val_label<-' applied to an object of class "haven_labelled"
  1: add_value_labels(df, s2 = c(Yes = 1, Unknown = 9)) at testthat/test-labelled.r:163
  2: `val_label<-`(`*tmp*`, values[[v]][[l]], value = l)
  
  ── 17. Error: dplyr::recode could be applied to numeric labelled vector (@test-l
  no applicable method for 'recode' applied to an object of class "haven_labelled"
  1: dplyr::recode(labelled(1:3, c(yes = 1, no = 2)), `3` = 2L) at testthat/test-labelled.r:188
  
  ── 18. Error: dplyr::recode could be applied to character labelled vector (@test
  no applicable method for 'recode' applied to an object of class "haven_labelled"
  1: dplyr::recode(labelled(c("a", "b", "c"), c(yes = "a", no = "b")), c = "b") at testthat/test-labelled.r:193
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 20 SKIPPED: 0 FAILED: 18
  1. Failure: labelled return an object of class labelled (@test-labelled.r#6) 
  2. Failure: labelled preserves variable label (@test-labelled.r#27) 
  3. Failure: val_labels preserves variable label (@test-labelled.r#36) 
  4. Failure: val_labels preserves variable label (@test-labelled.r#39) 
  5. Failure: val_label preserves variable label (@test-labelled.r#46) 
  6. Error: val_label preserves variable label (@test-labelled.r#48) 
  7. Error: val_labels and val_label preserves spss missing values (@test-labelled.r#55) 
  8. Failure: value labels can't be removed if missing values are defined (@test-labelled.r#72) 
  9. Failure: remove_labels strips labelled attributes (@test-labelled.r#83) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted