Running ‘testthat.R’ [3s/4s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > 
  > test_check("PerformanceAnalytics")
  Loading required package: PerformanceAnalytics
  Loading required package: xts
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  
  Attaching package: 'PerformanceAnalytics'
  
  The following object is masked from 'package:graphics':
  
      legend
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  PerformanceAnalytics
   --- call from context --- 
  checkData(Contributions)
   --- call from argument --- 
  if (class(x) == "numeric") {
      x = zoo(matrix(x, ncol = NCOL(x)))
      if (!quiet) 
          warning("The data cannot be converted into a time series.  Returning a 'zoo' object. ")
  } else stop("The data cannot be converted into a time series.  If you are trying to pass in names from a data object with one column, you should use the form 'data[rows, columns, drop = FALSE]'.  Rownames should have standard date formats, such as '1985-03-15'. ")
   --- R stacktrace ---
  where 1: checkData(Contributions)
  where 2: to.period.contributions(malformed_contribution)
  where 3: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  where 4: withCallingHandlers({
      code
      NULL
  }, error = function(cnd) {
      cnd <- cnd_entrace(cnd)
      return_from(env, cnd)
  })
  where 5: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), 
      ...)
  where 6: quasi_capture(enquo(object), label, capture_error, entrace = TRUE)
  where 7 at testthat/test_toPeriodContributions.R#61: expect_error(to.period.contributions(malformed_contribution))
  where 8: eval(code, test_env)
  where 9: eval(code, test_env)
  where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 14: doTryCatch(return(expr), name, parentenv, handler)
  where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 16: tryCatchList(expr, classes, parentenv, handlers)
  where 17: 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 18: test_code(desc, code, env = parent.frame())
  where 19 at testthat/test_toPeriodContributions.R#59: test_that("invalid parameters are handled correctly", {
      expect_error(to.period.contributions(contribution, "daily"))
      expect_error(to.period.contributions(malformed_contribution))
  })
  where 20: eval(code, test_env)
  where 21: eval(code, test_env)
  where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 26: doTryCatch(return(expr), name, parentenv, handler)
  where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 28: tryCatchList(expr, classes, parentenv, handlers)
  where 29: 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 30: test_code(NULL, exprs, env)
  where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 32: force(code)
  where 33: doWithOneRestart(return(expr), restart)
  where 34: withOneRestart(expr, restarts[[1L]])
  where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 36: 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 37: FUN(X[[i]], ...)
  where 38: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 39: force(code)
  where 40: doWithOneRestart(return(expr), restart)
  where 41: withOneRestart(expr, restarts[[1L]])
  where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 45: 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 46: 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 47: test_check("PerformanceAnalytics")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, method = c("xts", "zoo", "data.frame", "matrix", 
      "vector"), na.rm = TRUE, quiet = TRUE, ...) 
  {
      method = method[1]
      switch(method, vector = {
          if (NCOL(x) > 1) {
              if (!quiet) warning("The data provided is not a vector or univariate time series.  Used only the first column")
              x = x[, 1]
          }
          if (na.rm) x = na.omit(x)
          x = as.vector(x)
      }, matrix = {
          x = as.matrix(x, ncol = NCOL(x))
      }, data.frame = {
          x = as.data.frame(x)
      }, zoo = {
          if (inherits(x, what = "zoo")) {
              x = as.zoo(x)
          } else {
              if (class(x) == "matrix" | class(x) == "data.frame") {
                  x = zoo(x, order.by = as.POSIXct(rownames(x)))
              } else {
                  if (class(x) == "numeric") {
                    if (is.null(names(x))) x = zoo(matrix(x, ncol = NCOL(x))) else x = zoo(matrix(x, 
                      ncol = NCOL(x)), order.by = as.POSIXct(names(x)))
                  }
              }
          }
      }, xts = {
          if (is.xts(x)) return(x)
          if (!xtsible(x)) if (class(x) == "numeric") {
              x = zoo(matrix(x, ncol = NCOL(x)))
              if (!quiet) warning("The data cannot be converted into a time series.  Returning a 'zoo' object. ")
          } else stop("The data cannot be converted into a time series.  If you are trying to pass in names from a data object with one column, you should use the form 'data[rows, columns, drop = FALSE]'.  Rownames should have standard date formats, such as '1985-03-15'. ") else x = try.xts(x)
      })
      return(x)
  }
  <bytecode: 0x55b038affad8>
  <environment: namespace:PerformanceAnalytics>
   --- function search by body ---
  Function checkData in namespace PerformanceAnalytics has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1