Running ‘testthat.R’ [12s/31s]
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.2     ✔ dplyr   1.0.7
  ✔ tidyr   1.1.3     ✔ stringr 1.4.0
  ✔ readr   1.4.0     ✔ forcats 0.5.1
  ── 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()
  > library(dplyr)
  > library(tibble)
  > 
  > test_check("tidyquant")
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (2)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-tq_mutate.R:118:5): Test 5 returns tibble with correct rows and columns. ──
  nrow(test5) not equal to 504.
  1/1 mismatches
  [1] 252 - 504 == -252
  ── Failure (test-tq_performance.R:39:5): Test1 returns grouped tibble of appropriate size ──
  dplyr::group_size(test1) %>% length() not equal to 3.
  1/1 mismatches
  [1] 2 - 3 == -1
  ── Failure (test-tq_performance.R:41:5): Test1 returns grouped tibble of appropriate size ──
  nrow(test1) not equal to 3.
  1/1 mismatches
  [1] 2 - 3 == -1
  ── Failure (test-tq_performance.R:50:5): Test2 returns grouped tibble of appropriate size ──
  dplyr::group_size(test2) %>% length() not equal to 3.
  1/1 mismatches
  [1] 2 - 3 == -1
  ── Failure (test-tq_performance.R:52:5): Test2 returns grouped tibble of appropriate size ──
  nrow(test2) not equal to 3.
  1/1 mismatches
  [1] 2 - 3 == -1
  ── Error (test-tq_portfolio.R:21:1): (code run outside of `test_that()`) ───────
  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 4 | SKIP 2 | PASS 90 ]
  Error: Test failures
  In addition: Warning messages:
  1: closing unused connection 7 (https://query1.finance.yahoo.com/v7/finance/download/XYZ?period1=1293840000&period2=1626307200&interval=1d&events=history&crumb=UPkcfIdx2kh) 
  2: closing unused connection 6 (https://query1.finance.yahoo.com/v7/finance/download/XYZ?period1=1293840000&period2=1626307200&interval=1d&events=history&crumb=.Qduitjgce3) 
  3: closing unused connection 5 (https://fred.stlouisfed.org/series/XYZ/downloaddata/XYZ.csv) 
  4: closing unused connection 4 (https://fred.stlouisfed.org/series/XYZ/downloaddata/XYZ.csv) 
  5: In for (i in seq_along(varnames)) predvars[[i + 1L]] <- makepredictcall(variables[[i]],  :
    closing unused connection 4 (https://query1.finance.yahoo.com/v7/finance/download/AAPL?period1=1451606400&period2=1483228800&interval=1d&events=history&crumb=Fr8PnCT0AX5)
  6: In for (i in seq_len(n)) { :
    closing unused connection 4 (https://query2.finance.yahoo.com/v7/finance/download/AAPL?period1=1262304000&period2=1451520000&interval=1d&events=history&crumb=Z52uYxwnItj)
  7: closing unused connection 4 (https://query1.finance.yahoo.com/v7/finance/download/NFLX?period1=1262304000&period2=1451520000&interval=1d&events=history&crumb=urzwXcqP36d) 
  Execution halted