Running ‘testthat.R’ [8s/11s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > 
  > library("testthat")
  > #library("vcfR")
  > #
  > #
  > test_check("vcfR")
  Loading required package: vcfR
  
     *****       ***   vcfR   ***       *****
     This is vcfR 1.8.0 
       browseVignettes('vcfR') # Documentation
       citation('vcfR') # Citation
     *****       *****      *****       *****
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  vcfR
   --- call from context --- 
  extract.gt(x, element = "GT")
   --- call from argument --- 
  if (class(x@gt) != "matrix") {
      stop(paste("gt slot expected to be of class matrix. Instead found class", 
          class(x@gt)))
  }
   --- R stacktrace ---
  where 1: extract.gt(x, element = "GT")
  where 2: gt.to.popsum(x)
  where 3: system.time(x <- gt.to.popsum(x))
  where 4 at testthat/test_015_write_vcfR.R#97: proc.chromR(chrom, verbose = FALSE)
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test_015_write_vcfR.R#95: test_that("write.win.info works for Chrom objects", {
      data("chromR_example")
      chrom <- proc.chromR(chrom, verbose = FALSE)
      test_dir <- tempdir()
      setwd(test_dir)
      write.win.info(chrom, "test.csv")
      test <- read.table("test.csv", header = TRUE, sep = ",")
      unlink("test.csv")
      expect_is(test, "data.frame")
      expect_equal(nrow(test), nrow(chrom@win.info))
      expect_equal(grep("CHROM", names(test), value = TRUE), "CHROM")
      expect_equal(grep("window", names(test), value = TRUE), "window")
      expect_equal(grep("start", names(test), value = TRUE), "start")
      expect_equal(grep("end", names(test), value = TRUE), "end")
  })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 43: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_check("vcfR")
  
   --- value of length: 2 type: logical ---
  [1] FALSE  TRUE
   --- function from context --- 
  function (x, element = "GT", mask = FALSE, as.numeric = FALSE, 
      return.alleles = FALSE, IDtoRowNames = TRUE, extract = TRUE, 
      convertNA = TRUE) 
  {
      if (class(x) != "chromR" & class(x) != "vcfR") {
          stop("Expected an object of class chromR or vcfR")
      }
      if (class(x) == "vcfR") {
          if (length(mask) == 1 && mask == TRUE) {
              mask <- FALSE
          }
      }
      if (class(x) == "chromR") {
          tmpMask <- x@var.info$mask
          x <- x@vcf
      }
      if (length(mask) > 1) {
          tmpMask <- mask
          mask <- TRUE
      }
      if (class(x@gt) != "matrix") {
          stop(paste("gt slot expected to be of class matrix. Instead found class", 
              class(x@gt)))
      }
      if (as.numeric == TRUE & return.alleles == TRUE) {
          stop("Invalid parameter choice, as.numeric and return.alleles can't both be true, alleles are characters!")
      }
      if (class(x) == "vcfR") {
          if (colnames(x@gt)[1] != "FORMAT") {
              stop("First column is not named 'FORMAT', this is essential information.")
          }
          outM <- .extract_GT_to_CM(x@fix, x@gt, element, return.alleles, 
              as.integer(extract), convertNA = as.numeric(convertNA))
      }
      if (as.numeric == TRUE) {
          outM <- .CM_to_NM(outM)
      }
      if (IDtoRowNames == TRUE) {
          if (sum(is.na(x@fix[, "ID"])) > 0) {
              x <- addID(x)
          }
          if (length(unique(x@fix[, "ID"])) != nrow(x@fix)) {
              stop("ID column contains non-unique names")
          }
          rownames(outM) <- x@fix[, "ID"]
      }
      if (mask == TRUE) {
          outM <- outM[tmpMask, ]
      }
      return(outM)
  }
  <bytecode: 0x56105406f098>
  <environment: namespace:vcfR>
   --- function search by body ---
  Function extract.gt in namespace vcfR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1