Running ‘testthat.R’ [19s/137s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(tidyquant)
  Loading required package: lubridate
  
  Attaching package: 'lubridate'
  
  The following objects are masked from 'package:base':
  
      date, intersect, setdiff, union
  
  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
  ══ 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.3.1 ──
  ✔ ggplot2 3.3.5     ✔ purrr   0.3.4
  ✔ tibble  3.1.6     ✔ dplyr   1.0.7
  ✔ tidyr   1.1.4     ✔ stringr 1.4.0
  ✔ readr   2.0.2     ✔ forcats 0.5.1
  ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
  ✖ lubridate::as.difftime() masks base::as.difftime()
  ✖ lubridate::date()        masks base::date()
  ✖ readr::edition_get()     masks testthat::edition_get()
  ✖ 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()
  ✖ readr::local_edition()   masks testthat::local_edition()
  ✖ dplyr::matches()         masks tidyr::matches(), testthat::matches()
  ✖ lubridate::setdiff()     masks base::setdiff()
  ✖ lubridate::union()       masks base::union()
  > library(dplyr)
  > library(tibble)
  > 
  > test_check("tidyquant")
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (2)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-tq_get_stock_prices.R:17:5): Test 1 returns tibble with correct rows and columns. ──
  `test1` inherits from `'logical'` not `'character'`.
  ── Failure (test-tq_get_stock_prices.R:19:5): Test 1 returns tibble with correct rows and columns. ──
  nrow(test1) not equal to 103.
  target is NULL, current is numeric
  ── Failure (test-tq_get_stock_prices.R:21:5): Test 1 returns tibble with correct rows and columns. ──
  ncol(test1) not equal to 8.
  target is NULL, current is numeric
  ── Failure (test-tq_get_stock_prices.R:28:5): Test 2 returns tibble with correct rows and columns. ──
  nrow(test2) not equal to 206.
  1/1 mismatches
  [1] 103 - 206 == -103
  ── Error (test-tq_mutate.R:8:1): (code run outside of `test_that()`) ───────────
  Error in `tq_mutate_.default(data = data, select = lazyeval::expr_text(select), 
      mutate_fun = lazyeval::expr_text(mutate_fun), col_rename = col_rename, 
      ... = ...)`: data must be a tibble or data.frame object
  Backtrace:
      █
   1. ├─`%>%`(...) test-tq_mutate.R:8:0
   2. ├─tidyquant::tq_mutate(., open:close, OpCl)
   3. │ └─tidyquant::tq_mutate_(...)
   4. ├─tidyquant::tq_mutate(., high:close, BBands)
   5. │ └─tidyquant::tq_mutate_(...)
   6. └─tidyquant::tq_mutate(., close, MACD)
   7.   ├─tidyquant::tq_mutate_(...)
   8.   └─tidyquant:::tq_mutate_.default(...)
  ── Error (test-tq_portfolio.R:21:1): (code run outside of `test_that()`) ───────
  <vctrs_error_incompatible_size/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
  Error: Can't recycle `..1` (size 2) to match `..2` (size 3).
  Backtrace:
       █
    1. ├─tidyquant::tq_portfolio(...) test-tq_portfolio.R:21:0
    2. │ ├─tidyquant::tq_portfolio_(...)
    3. │ └─tidyquant:::tq_portfolio_.grouped_df(...)
    4. │   ├─tidyquant::tq_portfolio_(...)
    5. │   └─tidyquant:::tq_portfolio_.tbl_df(...)
    6. │     └─tidyquant:::tq_portfolio_base_(...)
    7. │       ├─base::tryCatch(...)
    8. │       │ └─base:::tryCatchList(expr, classes, parentenv, handlers)
    9. │       │   └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   10. │       │     └─base:::doTryCatch(return(expr), name, parentenv, handler)
   11. │       └─tidyquant:::map_weights(weights, assets_col)
   12. │         └─dplyr::bind_cols(unique(assets_col), tibble::tibble(weights))
   13. │           └─vctrs::vec_cbind(!!!dots, .name_repair = .name_repair)
   14. └─vctrs::stop_incompatible_size(...)
   15.   └─vctrs:::stop_incompatible(...)
   16.     └─vctrs:::stop_vctrs(...)
  
  [ FAIL 6 | WARN 37 | SKIP 2 | PASS 67 ]
  Error: Test failures
  In addition: Warning messages:
  1: In tbl_subset_row(xo, i = i, i_arg) :
    closing unused connection 10 (https://query2.finance.yahoo.com/v7/finance/download/AAPL?period1=1262304000&period2=1420070400&interval=1d&events=history&crumb=mPYW6jM/P2G)
  2: In tbl_subset_row(xo, i = i, i_arg) :
    closing unused connection 9 (https://query2.finance.yahoo.com/v7/finance/download/XYZ?period1=1293840000&period2=1636416000&interval=1d&events=history&crumb=Iv1f0xg9c8w)
  3: In tbl_subset_row(xo, i = i, i_arg) :
    closing unused connection 8 (https://query1.finance.yahoo.com/v7/finance/download/XYZ?period1=1293840000&period2=1636416000&interval=1d&events=history&crumb=WMm9pisYtqS)
  4: In tbl_subset_row(xo, i = i, i_arg) :
    closing unused connection 7 (https://query2.finance.yahoo.com/v7/finance/download/FB?period1=1451606400&period2=1464739200&interval=1d&events=history&crumb=T4XJ1mXTEht)
  5: In tbl_subset_row(xo, i = i, i_arg) :
    closing unused connection 6 (https://query2.finance.yahoo.com/v7/finance/download/AAPL?period1=1451606400&period2=1464739200&interval=1d&events=history&crumb=fCsYlSgfSx3)
  6: In tbl_subset_row(xo, i = i, i_arg) :
    closing unused connection 5 (https://fred.stlouisfed.org/series/XYZ/downloaddata/XYZ.csv)
  7: In tbl_subset_row(xo, i = i, i_arg) :
    closing unused connection 4 (https://fred.stlouisfed.org/series/XYZ/downloaddata/XYZ.csv)
  8: In for (i in ic) value[[i]] <- as.vector(x[, i]) :
    closing unused connection 4 (https://query2.finance.yahoo.com/v7/finance/download/GOOG?period1=1262304000&period2=1451520000&interval=1d&events=history&crumb=faDb4PUTkO4)
  Execution halted