Running ‘testthat.R’ [3s/3s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(dispositionEffect)
  --------------------------------------------
  The dispositionEffect is the first R package to perform behavioural analysis on financial data.
  Use citation('dispositionEffect') to cite the package.
  Learn more at: https://marcozanotti.github.io/dispositionEffect/index.html
  --------------------------------------------
  > 
  > test_check("dispositionEffect")
  Saving _problems/test-paper_compute-48.R
  Saving _problems/test-paper_compute-54.R
  Saving _problems/test-portfolio_compute-10.R
  Saving _problems/test-portfolio_compute-11.R
  Saving _problems/test-realized_compute-81.R
  Saving _problems/test-realized_compute-93.R
  Saving _problems/test-realized_duration-23.R
  Saving _problems/test-realized_duration-26.R
  Saving _problems/test-realized_duration-29.R
  Saving _problems/test-realized_duration-32.R
  Saving _problems/test-realized_duration-35.R
  Saving _problems/test-realized_duration-38.R
  Saving _problems/test-realized_duration-44.R
  Saving _problems/test-realized_duration-47.R
  Saving _problems/test-realized_duration-50.R
  Saving _problems/test-realized_duration-53.R
  Saving _problems/test-realized_duration-56.R
  Saving _problems/test-realized_duration-59.R
  Saving _problems/test-realized_duration-66.R
  Saving _problems/test-realized_duration-69.R
  Saving _problems/test-realized_duration-72.R
  Saving _problems/test-realized_duration-75.R
  Saving _problems/test-realized_duration-78.R
  Saving _problems/test-realized_duration-81.R
  Saving _problems/test-realized_duration-114.R
  Saving _problems/test-realized_duration-117.R
  Saving _problems/test-realized_duration-120.R
  Saving _problems/test-realized_duration-123.R
  Saving _problems/test-realized_duration-133.R
  Saving _problems/test-realized_duration-136.R
  Saving _problems/test-realized_duration-139.R
  Saving _problems/test-realized_duration-142.R
  Saving _problems/test-realized_duration-153.R
  Saving _problems/test-realized_duration-156.R
  Saving _problems/test-realized_duration-159.R
  Saving _problems/test-realized_duration-162.R
  [ FAIL 36 | WARN 0 | SKIP 0 | PASS 331 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-paper_compute.R:46:2'): paper_compute works (method = duration) ──
  Expected `paper_compute(...)` to equal `res[, c(1, 14:17)]`.
  Differences:
  Component "PG_duration": Mean relative difference: 0.06666667
  Component "PL_duration": Mean relative difference: 0.06666667
  ── Failure ('test-paper_compute.R:52:2'): paper_compute works (method = all) ───
  Expected `paper_compute(...)` to equal `res`.
  Differences:
  Component "PG_duration": Mean relative difference: 0.06666667
  Component "PL_duration": Mean relative difference: 0.06666667
  ── Failure ('test-portfolio_compute.R:10:2'): portfolio_compute works (arg method) ──
  Expected `portfolio_compute(investor, marketprices, method = "duration")` to equal `portfolio_results[, c(1:5, 18:21)]`.
  Differences:
  Component "RG_duration": Mean relative difference: 0.007344991
  Component "RL_duration": Mean relative difference: 0.04026507
  Component "PG_duration": Mean relative difference: 0.07414429
  ── Failure ('test-portfolio_compute.R:11:2'): portfolio_compute works (arg method) ──
  Expected `portfolio_compute(investor, marketprices, method = "all")` to equal `portfolio_results`.
  Differences:
  Component "RG_duration": Mean relative difference: 0.007344991
  Component "RL_duration": Mean relative difference: 0.04026507
  Component "PG_duration": Mean relative difference: 0.07414429
  ── Failure ('test-realized_compute.R:73:2'): realized_compute works (method = duration) ──
  Expected `dplyr::bind_rows(...)` to equal `res[, c(1, 14:17)]`.
  Differences:
  Component "RG_duration": Mean relative difference: 0.03448276
  Component "RL_duration": Mean relative difference: 0.03448276
  Component "PG_duration": Mean relative difference: 0.06666667
  Component "PL_duration": Mean relative difference: 0.06666667
  ── Failure ('test-realized_compute.R:85:2'): realized_compute works (method = all) ──
  Expected `dplyr::bind_rows(...)` to equal `res`.
  Differences:
  Component "RG_duration": Mean relative difference: 0.03448276
  Component "RL_duration": Mean relative difference: 0.03448276
  Component "PG_duration": Mean relative difference: 0.06666667
  Component "PL_duration": Mean relative difference: 0.06666667
  ── Failure ('test-realized_duration.R:22:2'): realized_duration works (long) ───
  Expected `realized_duration(2, 15, 1, 10, "B", pt_dtt, p_dtt, t_dtt, allow_short = TRUE)` to equal `c(RG_duration = 0, RL_duration = 0, PG_duration = 0, PL_duration = dtt_diff)`.
  Differences:
  1/4 mismatches
  [4] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:25:2'): realized_duration works (long) ───
  Expected `realized_duration(2, 10, 1, 15, "B", pt_dtt, p_dtt, t_dtt, allow_short = TRUE)` to equal `c(RG_duration = 0, RL_duration = 0, PG_duration = dtt_diff, PL_duration = 0)`.
  Differences:
  1/4 mismatches
  [3] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:28:2'): realized_duration works (long) ───
  Expected `realized_duration(2, 15, -1, 10, "S", pt_dtt, p_dtt, t_dtt, allow_short = TRUE)` to equal `c(...)`.
  Differences:
  2/4 mismatches (average diff: 1)
  [2] 29 - 28 == 1
  [4] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:31:2'): realized_duration works (long) ───
  Expected `realized_duration(2, 10, -1, 15, "S", pt_dtt, p_dtt, t_dtt, allow_short = TRUE)` to equal `c(...)`.
  Differences:
  2/4 mismatches (average diff: 1)
  [1] 29 - 28 == 1
  [3] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:34:2'): realized_duration works (long) ───
  Expected `realized_duration(2, 15, -2, 10, "S", pt_dtt, p_dtt, t_dtt, allow_short = TRUE)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [2] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:37:2'): realized_duration works (long) ───
  Expected `realized_duration(2, 10, -2, 15, "S", pt_dtt, p_dtt, t_dtt, allow_short = TRUE)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [1] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:43:2'): realized_duration works (short) ──
  Expected `realized_duration(...)` to equal `c(RG_duration = 0, RL_duration = 0, PG_duration = dtt_diff, PL_duration = 0)`.
  Differences:
  1/4 mismatches
  [3] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:46:2'): realized_duration works (short) ──
  Expected `realized_duration(...)` to equal `c(RG_duration = 0, RL_duration = 0, PG_duration = 0, PL_duration = dtt_diff)`.
  Differences:
  1/4 mismatches
  [4] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:49:2'): realized_duration works (short) ──
  Expected `realized_duration(-2, 15, 1, 10, "B", pt_dtt, p_dtt, t_dtt, allow_short = TRUE)` to equal `c(...)`.
  Differences:
  2/4 mismatches (average diff: 1)
  [1] 29 - 28 == 1
  [3] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:52:2'): realized_duration works (short) ──
  Expected `realized_duration(-2, 10, 1, 15, "B", pt_dtt, p_dtt, t_dtt, allow_short = TRUE)` to equal `c(...)`.
  Differences:
  2/4 mismatches (average diff: 1)
  [2] 29 - 28 == 1
  [4] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:55:2'): realized_duration works (short) ──
  Expected `realized_duration(-2, 15, 2, 10, "B", pt_dtt, p_dtt, t_dtt, allow_short = TRUE)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [1] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:58:2'): realized_duration works (short) ──
  Expected `realized_duration(-2, 10, 2, 15, "B", pt_dtt, p_dtt, t_dtt, allow_short = TRUE)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [2] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:65:2'): realized_duration works (allow_short = FALSE) ──
  Expected `realized_duration(2, 15, 1, 10, "B", pt_dtt, p_dtt, t_dtt, allow_short = FALSE)` to equal `c(RG_duration = 0, RL_duration = 0, PG_duration = 0, PL_duration = dtt_diff)`.
  Differences:
  1/4 mismatches
  [4] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:68:2'): realized_duration works (allow_short = FALSE) ──
  Expected `realized_duration(2, 10, 1, 15, "B", pt_dtt, p_dtt, t_dtt, allow_short = FALSE)` to equal `c(RG_duration = 0, RL_duration = 0, PG_duration = dtt_diff, PL_duration = 0)`.
  Differences:
  1/4 mismatches
  [3] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:71:2'): realized_duration works (allow_short = FALSE) ──
  Expected `realized_duration(2, 15, -1, 10, "S", pt_dtt, p_dtt, t_dtt, allow_short = FALSE)` to equal `c(...)`.
  Differences:
  2/4 mismatches (average diff: 1)
  [2] 29 - 28 == 1
  [4] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:74:2'): realized_duration works (allow_short = FALSE) ──
  Expected `realized_duration(2, 10, -1, 15, "S", pt_dtt, p_dtt, t_dtt, allow_short = FALSE)` to equal `c(...)`.
  Differences:
  2/4 mismatches (average diff: 1)
  [1] 29 - 28 == 1
  [3] 15 - 14 == 1
  ── Failure ('test-realized_duration.R:77:2'): realized_duration works (allow_short = FALSE) ──
  Expected `realized_duration(2, 15, -2, 10, "S", pt_dtt, p_dtt, t_dtt, allow_short = FALSE)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [2] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:80:2'): realized_duration works (allow_short = FALSE) ──
  Expected `realized_duration(2, 10, -2, 15, "S", pt_dtt, p_dtt, t_dtt, allow_short = FALSE)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [1] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:113:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [2] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:116:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [1] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:119:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [2] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:122:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [1] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:132:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [1] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:135:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [2] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:138:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [1] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:141:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [2] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:152:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [2] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:155:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [1] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:158:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [2] 29 - 28 == 1
  ── Failure ('test-realized_duration.R:161:2'): realized_duration works (realized_only = TRUE) ──
  Expected `realized_duration(...)` to equal `c(...)`.
  Differences:
  1/4 mismatches
  [1] 29 - 28 == 1
  
  [ FAIL 36 | WARN 0 | SKIP 0 | PASS 331 ]
  Error:
  ! Test failures.
  Execution halted