Running ‘spelling.R’ [0s/1s]
  Comparing ‘spelling.Rout’ to ‘spelling.Rout.save’ ... OK
  Running ‘testthat.R’ [4s/7s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat)
  > library(DDIwR)
  Also attaching packages: admisc, declared, haven
  > 
  > test_check("DDIwR")
  
  
  
  
  
  
  
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 59 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-convert.R:107:1'): (code run outside of `test_that()`) ─────────
  Error in `var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm)`: is.atomic(y) is not TRUE
  Backtrace:
      ▆
   1. └─DDIwR::convert(dfm, to = file.path(tmp, "dfm.xml")) at test-convert.R:107:0
   2.   └─DDIwR::exportDDI(codebook = codeBook, file = to, ... = ...)
   3.     ├─base::cat(...)
   4.     ├─base::paste(...)
   5.     ├─base::format(sd(vals, na.rm = TRUE), scientific = FALSE)
   6.     └─declared (local) sd(vals, na.rm = TRUE)
   7.       └─declared (local) var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm)
   8.         └─base::stopifnot(is.atomic(y))
  ── Error ('test-exportDDI.R:10:1'): (code run outside of `test_that()`) ────────
  Error in `var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm)`: is.atomic(y) is not TRUE
  Backtrace:
      ▆
   1. └─DDIwR::exportDDI(codebook, file = file.path(tmp, "dfm.xml")) at test-exportDDI.R:10:0
   2.   ├─base::cat(...)
   3.   ├─base::paste(...)
   4.   ├─base::format(sd(vals, na.rm = TRUE), scientific = FALSE)
   5.   └─declared (local) sd(vals, na.rm = TRUE)
   6.     └─declared (local) var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm)
   7.       └─base::stopifnot(is.atomic(y))
  ── Error ('test-getMetadata.R:32:1'): (code run outside of `test_that()`) ──────
  Error in `var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm)`: is.atomic(y) is not TRUE
  Backtrace:
      ▆
   1. └─DDIwR::convert(x, to = file.path(tmp, "x.xml")) at test-getMetadata.R:32:0
   2.   └─DDIwR::exportDDI(codebook = codeBook, file = to, ... = ...)
   3.     ├─base::cat(...)
   4.     ├─base::paste(...)
   5.     ├─base::format(sd(vals, na.rm = TRUE), scientific = FALSE)
   6.     └─declared (local) sd(vals, na.rm = TRUE)
   7.       └─declared (local) var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm)
   8.         └─base::stopifnot(is.atomic(y))
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 59 ]
  Error: Test failures
  Execution halted