Running ‘testthat.R’ [9s/31s]
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.
  ══ Need to Learn tidyquant? ════════════════════════════════════════════════════
  Business Science offers a 1-hour course - Learning Lab #9: Performance Analysis & Portfolio Optimization with tidyquant!
  </> Learn more at: https://university.business-science.io/p/learning-labs-pro </>
  > library(tidyverse)
  ── Attaching packages ─────────────────────────────────────── tidyverse 1.2.1 ──
  ✔ ggplot2 3.2.1     ✔ purrr   0.3.3
  ✔ tibble  2.1.3     ✔ dplyr   0.8.3
  ✔ tidyr   1.0.0     ✔ stringr 1.4.0
  ✔ readr   1.3.1     ✔ forcats 0.4.0
  ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
  ✖ lubridate::as.difftime() masks base::as.difftime()
  ✖ lubridate::date()        masks base::date()
  ✖ dplyr::filter()          masks stats::filter()
  ✖ dplyr::first()           masks xts::first()
  ✖ lubridate::intersect()   masks base::intersect()
  ✖ purrr::is_null()         masks testthat::is_null()
  ✖ dplyr::lag()             masks stats::lag()
  ✖ dplyr::last()            masks xts::last()
  ✖ dplyr::matches()         masks tidyr::matches(), testthat::matches()
  ✖ lubridate::setdiff()     masks base::setdiff()
  ✖ lubridate::union()       masks base::union()
  > 
  > test_check("tidyquant")
  ── 1. Failure: Test 2 returns tibble with correct rows and columns. (@test_tq_ge
  nrow(test2) not equal to 2.
  1/1 mismatches
  [1] 0 - 2 == -2
  
  ── 2. Failure: Test 3 returns tibble with correct rows and columns. (@test_tq_ge
  nrow(test3) not equal to 3.
  1/1 mismatches
  [1] 1 - 3 == -2
  
  ── 3. Failure: Test returns tibble with correct rows and columns. (@test_tq_get_
  `test1` inherits from `logical` not `tbl`.
  
  ── 4. Failure: Test returns tibble with correct rows and columns. (@test_tq_get_
  nrow(test1) not equal to 2.
  target is NULL, current is numeric
  
  ── 5. Failure: Test returns tibble with correct rows and columns. (@test_tq_get_
  ncol(test1) not equal to 2.
  target is NULL, current is numeric
  
  ── 6. Error: (unknown) (@test_tq_performance.R#16)  ────────────────────────────
  data must be a tibble or data.frame object
  1: "^GSPC" %>% tq_get(get = "stock.prices", from = "2010-01-01", to = "2015-12-31") %>% 
         tq_transmute(adjusted, periodReturn, period = "monthly", col_rename = "Rb") at testthat/test_tq_performance.R:16
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: tq_transmute(., adjusted, periodReturn, period = "monthly", col_rename = "Rb")
  10: tq_transmute_(data = data, select = lazyeval::expr_text(select), mutate_fun = lazyeval::expr_text(mutate_fun), 
         col_rename = col_rename, ... = ...)
  11: tq_transmute_.default(data = data, select = lazyeval::expr_text(select), mutate_fun = lazyeval::expr_text(mutate_fun), 
         col_rename = col_rename, ... = ...)
  12: stop("data must be a tibble or data.frame object")
  
  ── 7. Error: (unknown) (@test_tq_transmute.R#12)  ──────────────────────────────
  Can't cast `stock.prices$stock.prices` <logical> to `stock.prices$stock.prices` <vctrs_unspecified>.
  1: tibble(symbol = c("FB", "AMZN")) %>% dplyr::mutate(stock.prices = purrr::map(.x = symbol, 
         .f = ~tq_get(.x, get = "stock.prices", from = "2015-01-01", to = "2016-01-01"))) %>% 
         tidyr::unnest(cols = stock.prices) %>% dplyr::group_by(symbol) at testthat/test_tq_transmute.R:12
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: function_list[[i]](value)
  8: tidyr::unnest(., cols = stock.prices)
  9: unnest.data.frame(., cols = stock.prices)
  10: unchop(data, !!cols, keep_empty = keep_empty, ptype = ptype)
  11: vec_rbind(!!!x, .ptype = ptype)
  12: vec_cast_dispatch(x = x, to = to, x_arg = x_arg, to_arg = to_arg)
  13: vec_cast.data.frame(x = x, to = to, x_arg = x_arg, to_arg = to_arg)
  14: vec_cast.data.frame.data.frame(x = x, to = to, x_arg = x_arg, to_arg = to_arg)
  15: vec_cast_dispatch(x = x, to = to, x_arg = x_arg, to_arg = to_arg)
  16: vec_cast.default(x = x, to = to, x_arg = x_arg, to_arg = to_arg)
  17: stop_incompatible_cast(x, to, x_arg = x_arg, to_arg = to_arg)
  18: stop_incompatible(x, y, details = details, ..., x_arg = x_arg, y_arg = to_arg, message = message, 
         .subclass = c(.subclass, "vctrs_error_incompatible_cast"))
  19: stop_vctrs(message, .subclass = c(.subclass, "vctrs_error_incompatible"), x = x, 
         y = y, details = details, ...)
  20: abort(message, .subclass = c(.subclass, "vctrs_error"), ...)
  21: signal_abort(cnd)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 88 | SKIPPED: 1 | WARNINGS: 7 | FAILED: 7 ]
  1. Failure: Test 2 returns tibble with correct rows and columns. (@test_tq_get_compound_getters.R#33) 
  2. Failure: Test 3 returns tibble with correct rows and columns. (@test_tq_get_compound_getters.R#42) 
  3. Failure: Test returns tibble with correct rows and columns. (@test_tq_get_dividends.R#15) 
  4. Failure: Test returns tibble with correct rows and columns. (@test_tq_get_dividends.R#17) 
  5. Failure: Test returns tibble with correct rows and columns. (@test_tq_get_dividends.R#19) 
  6. Error: (unknown) (@test_tq_performance.R#16) 
  7. Error: (unknown) (@test_tq_transmute.R#12) 
  
  Error: testthat unit tests failed
  Execution halted