Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(haven)
  > 
  > test_check("haven")
  1. Failure: all labels (implicit missing values) are preserved when levels is 'default' or 'both' (#172) (@test-as-factor.R#24) 
  as_factor(s1) not equal to `exp`.
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component 2: Modes: numeric, character >
  Attributes: < Component 2: names for target but not for current >
  Attributes: < Component 2: target is numeric, current is character >
  
  
  2. Failure: all labels (implicit missing values) are preserved when levels is 'default' or 'both' (#172) (@test-as-factor.R#27) 
  as_factor(s1, levels = "both") not equal to `exp`.
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component 2: Modes: numeric, character >
  Attributes: < Component 2: names for target but not for current >
  Attributes: < Component 2: target is numeric, current is character >
  
  
  3. Failure: all labels (existing and missing) are sorted by values (#172) (@test-as-factor.R#33) 
  as_factor(s1) not equal to `exp`.
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component 2: Modes: numeric, character >
  Attributes: < Component 2: Lengths: 4, 5 >
  Attributes: < Component 2: names for target but not for current >
  Attributes: < Component 2: target is numeric, current is character >
  
  
  4. Failure: all values are preserved (@test-as-factor.R#39) --------------------
  as_factor(s1) not equal to `exp`.
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component 2: Modes: numeric, character >
  Attributes: < Component 2: Lengths: 1, 3 >
  Attributes: < Component 2: names for target but not for current >
  Attributes: < Component 2: target is numeric, current is character >
  
  
  5. Failure: character labelled converts to factor (@test-as-factor.R#45) -------
  as_factor(s1) not equal to `exp`.
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component 2: names for target but not for current >
  Attributes: < Component 2: 2 string mismatches >
  
  
  6. Failure: converts tagged NAs (@test-as-factor.R#51) -------------------------
  as_factor(s1) not equal to `exp`.
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component 2: Modes: numeric, character >
  Attributes: < Component 2: Lengths: 1, 3 >
  Attributes: < Component 2: names for target but not for current >
  Attributes: < Component 2: target is numeric, current is character >
  
  
  7. Failure: both combines values and levels (@test-as-factor.R#59) -------------
  as_factor(s1, "both") not equal to `exp`.
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component 2: Modes: numeric, character >
  Attributes: < Component 2: Lengths: 1, 2 >
  Attributes: < Component 2: names for target but not for current >
  Attributes: < Component 2: target is numeric, current is character >
  
  
  8. Failure: character labelled uses values when requested (@test-as-factor.R#67) 
  as_factor(s1, "values") not equal to `exp`.
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component 2: names for target but not for current >
  
  
  9. Failure: labels preserves all label values (@test-as-factor.R#74) -----------
  as_factor(var, "labels") not equal to factor("female", levels = c("female", "male")).
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component 2: Modes: numeric, character >
  Attributes: < Component 2: names for target but not for current >
  Attributes: < Component 2: target is numeric, current is character >
  
  
  10. Failure: order of labels doesn't matter (@test-as-factor.R#79) -------------
  as_factor(var, "labels") not equal to factor("male", levels = c("female", "male")).
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component 2: Modes: numeric, character >
  Attributes: < Component 2: names for target but not for current >
  Attributes: < Component 2: target is numeric, current is character >
  
  
  testthat results ================================================================
  OK: 143 SKIPPED: 0 FAILED: 10
  1.  Failure: all labels (implicit missing values) are preserved when levels is 'default' or 'both' (#172) (@test-as-factor.R#24) 
  2.  Failure: all labels (implicit missing values) are preserved when levels is 'default' or 'both' (#172) (@test-as-factor.R#27) 
  3.  Failure: all labels (existing and missing) are sorted by values (#172) (@test-as-factor.R#33) 
  4.  Failure: all values are preserved (@test-as-factor.R#39) 
  5.  Failure: character labelled converts to factor (@test-as-factor.R#45) 
  6.  Failure: converts tagged NAs (@test-as-factor.R#51) 
  7.  Failure: both combines values and levels (@test-as-factor.R#59) 
  8.  Failure: character labelled uses values when requested (@test-as-factor.R#67) 
  9.  Failure: labels preserves all label values (@test-as-factor.R#74) 
  10. Failure: order of labels doesn't matter (@test-as-factor.R#79) 
  
  Error: testthat unit tests failed
  Execution halted