Running ‘testthat.R’ [12s/62s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(tidyquant)
  Loading required package: lubridate
  
  Attaching package: 'lubridate'
  
  The following object is masked from 'package:base':
  
      date
  
  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
  
  Loading required package: quantmod
  Loading required package: TTR
  Version 0.4-0 included new data defaults. See ?getSymbols.
  Loading required package: tidyverse
  Loading tidyverse: ggplot2
  Loading tidyverse: tibble
  Loading tidyverse: tidyr
  Loading tidyverse: readr
  Loading tidyverse: purrr
  Loading tidyverse: dplyr
  Conflicts with tidy packages ---------------------------------------------------
  as.difftime(): lubridate, base
  date():        lubridate, base
  filter():      dplyr, stats
  first():       dplyr, xts
  intersect():   lubridate, base
  is_null():     purrr, testthat
  lag():         dplyr, stats
  last():        dplyr, xts
  matches():     dplyr, testthat
  setdiff():     lubridate, base
  union():       lubridate, base
  
  Attaching package: 'tidyquant'
  
  The following object is masked from 'package:tibble':
  
      as_tibble
  
  > 
  > test_check("tidyquant")
  'getSymbols' currently uses auto.assign=TRUE by default, but will
  use auto.assign=FALSE in 0.5-0. You will still be able to use
  'loadSymbols' to automatically load data. getOption("getSymbols.env")
  and getOption("getSymbols.auto.assign") will still be checked for
  alternate defaults.
  
  This message is shown once per session and may be disabled by setting 
  options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.
  
  WARNING: There have been significant changes to Yahoo Finance data.
  Please see the Warning section of '?getSymbols.yahoo' for details.
  
  This message is shown once per session and may be disabled by setting
  options("getSymbols.yahoo.warning"=FALSE).
  1. Error: Test prints warning message on invalid x input. (@test_tq_get_dividends.R#23) 
  'dimnames' applied to non-array
  1: expect_warning(tq_get("XYZ", get = get)) at testthat/test_tq_get_dividends.R:23
  2: capture_warnings(object)
  3: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  4: tq_get("XYZ", get = get)
  5: tq_get_base(x, get, complete_cases = complete_cases, map = FALSE, ...)
  6: tq_get_util_1(x, get, ...)
  7: ret %>% tidyquant::as_tibble(preserve_row_names = TRUE) %>% dplyr::rename(date = row.names) %>% 
         dplyr::mutate(date = lubridate::as_date(date))
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: `_fseq`(`_lhs`)
  12: freduce(value, `_function_list`)
  13: function_list[[i]](value)
  14: tidyquant::as_tibble(., preserve_row_names = TRUE)
  15: tryCatch({
         if (xts::is.xts(x) || zoo::is.zoo(x) || timeSeries::is.timeSeries(x) || stats::is.ts(x)) {
             matrix_to_tibble(as.matrix(x), preserve_row_names, ...)
         }
         else if (tseries::is.irts(x)) {
             matrix_to_tibble(x %>% xts::as.xts() %>% as.matrix(), preserve_row_names, 
                 ...)
         }
         else if (is.matrix(x)) {
             matrix_to_tibble(x, preserve_row_names, ...)
         }
         else {
             if (preserve_row_names) 
                 warn <- TRUE
             tibble::as_tibble(x, ...)
         }
     }, error = function(e) {
         warning(paste0("Error at ", x, ": Could not convert to tibble. Check input."))
         NA
     })
  16: tryCatchList(expr, classes, parentenv, handlers)
  17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  18: value[[3L]](cond)
  19: warning(paste0("Error at ", x, ": Could not convert to tibble. Check input."))
  20: paste0("Error at ", x, ": Could not convert to tibble. Check input.")
  21: as.character(structure(logical(0), .Dim = 0:1, index = structure(numeric(0), tzone = "UTC", tclass = "Date"), .indexCLASS = "Date", tclass = "Date", .indexTZ = "UTC", tzone = "UTC", .Dimnames = list(
         NULL, "dividends"), class = c("xts", "zoo")))
  22: as.character.default(structure(logical(0), .Dim = 0:1, index = structure(numeric(0), tzone = "UTC", tclass = "Date"), .indexCLASS = "Date", tclass = "Date", .indexTZ = "UTC", tzone = "UTC", .Dimnames = list(
         NULL, "dividends"), class = c("xts", "zoo")))
  23: as.vector(x, "character")
  24: as.vector.zoo(x, "character")
  25: as.vector(as.matrix(x), mode = mode)
  26: as.matrix(x)
  27: as.matrix.xts(x)
  
  2. Error: Test returns NA on invalid x input. (@test_tq_get_dividends.R#27) ----
  'dimnames' applied to non-array
  1: expect_equal(suppressWarnings(tq_get("XYZ", get = get)), NA) at testthat/test_tq_get_dividends.R:27
  2: compare(object, expected, ...)
  3: suppressWarnings(tq_get("XYZ", get = get))
  4: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  5: tq_get("XYZ", get = get)
  6: tq_get_base(x, get, complete_cases = complete_cases, map = FALSE, ...)
  7: tq_get_util_1(x, get, ...)
  8: ret %>% tidyquant::as_tibble(preserve_row_names = TRUE) %>% dplyr::rename(date = row.names) %>% 
         dplyr::mutate(date = lubridate::as_date(date))
  9: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: eval(quote(`_fseq`(`_lhs`)), env, env)
  12: `_fseq`(`_lhs`)
  13: freduce(value, `_function_list`)
  14: function_list[[i]](value)
  15: tidyquant::as_tibble(., preserve_row_names = TRUE)
  16: tryCatch({
         if (xts::is.xts(x) || zoo::is.zoo(x) || timeSeries::is.timeSeries(x) || stats::is.ts(x)) {
             matrix_to_tibble(as.matrix(x), preserve_row_names, ...)
         }
         else if (tseries::is.irts(x)) {
             matrix_to_tibble(x %>% xts::as.xts() %>% as.matrix(), preserve_row_names, 
                 ...)
         }
         else if (is.matrix(x)) {
             matrix_to_tibble(x, preserve_row_names, ...)
         }
         else {
             if (preserve_row_names) 
                 warn <- TRUE
             tibble::as_tibble(x, ...)
         }
     }, error = function(e) {
         warning(paste0("Error at ", x, ": Could not convert to tibble. Check input."))
         NA
     })
  17: tryCatchList(expr, classes, parentenv, handlers)
  18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  19: value[[3L]](cond)
  20: warning(paste0("Error at ", x, ": Could not convert to tibble. Check input."))
  21: paste0("Error at ", x, ": Could not convert to tibble. Check input.")
  22: as.character(structure(logical(0), .Dim = 0:1, index = structure(numeric(0), tzone = "UTC", tclass = "Date"), .indexCLASS = "Date", tclass = "Date", .indexTZ = "UTC", tzone = "UTC", .Dimnames = list(
         NULL, "dividends"), class = c("xts", "zoo")))
  23: as.character.default(structure(logical(0), .Dim = 0:1, index = structure(numeric(0), tzone = "UTC", tclass = "Date"), .indexCLASS = "Date", tclass = "Date", .indexTZ = "UTC", tzone = "UTC", .Dimnames = list(
         NULL, "dividends"), class = c("xts", "zoo")))
  24: as.vector(x, "character")
  25: as.vector.zoo(x, "character")
  26: as.vector(as.matrix(x), mode = mode)
  27: as.matrix(x)
  28: as.matrix.xts(x)
  
  3. Failure: Test prints warning message on invalid x input. (@test_tq_get_splits.R#23) 
  tq_get("XYZ", get = get) showed 0 warnings
  
  
  4. Failure: Test 1 returns tibble with correct rows and columns. (@test_tq_get_stock_prices.R#19) 
  nrow(test1) not equal to 104.
  1/1 mismatches
  [1] 103 - 104 == -1
  
  
  5. Failure: Test 2 returns tibble with correct rows and columns. (@test_tq_get_stock_prices.R#28) 
  nrow(test2) not equal to 208.
  1/1 mismatches
  [1] 206 - 208 == -2
  
  
  testthat results ================================================================
  OK: 185 SKIPPED: 2 FAILED: 5
  1. Error: Test prints warning message on invalid x input. (@test_tq_get_dividends.R#23) 
  2. Error: Test returns NA on invalid x input. (@test_tq_get_dividends.R#27) 
  3. Failure: Test prints warning message on invalid x input. (@test_tq_get_splits.R#23) 
  4. Failure: Test 1 returns tibble with correct rows and columns. (@test_tq_get_stock_prices.R#19) 
  5. Failure: Test 2 returns tibble with correct rows and columns. (@test_tq_get_stock_prices.R#28) 
  
  Error: testthat unit tests failed
  Execution halted