Running ‘testthat.R’ [3s/15s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(sarp.snowprofile.alignment)
  Loading required package: sarp.snowprofile
  > 
  > test_check("sarp.snowprofile.alignment")
  Saving _problems/test-distanceSP-8.R
  Saving _problems/test-dtwSP-8.R
  Saving _problems/test-dtwSP-19.R
  Saving _problems/test-dtwSP-31.R
  Saving _problems/test-dtwSP-42.R
  Saving _problems/test-dtwSP-54.R
  Saving _problems/test-dtwSP-77.R
  Saving _problems/test-dtwSP-112.R
  Saving _problems/test-dtwSP-124.R
  [ FAIL 9 | WARN 0 | SKIP 0 | PASS 0 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-distanceSP.R:5:3'): simSP calculated as anticipated ────────────
  Error in `r[i1] - r[if (lag < (len <- length(r))) -len:-(len - lag + 1L) else i0]`: non-numeric argument to binary operator
  Backtrace:
      ▆
   1. └─sarp.snowprofile.alignment::dtwSP(...) at test-distanceSP.R:5:3
   2.   └─sarp.snowprofile.alignment::resampleSP(ref, h = resamplingRate)
   3.     └─sarp.snowprofile::snowprofileLayers(...)
   4.       └─sarp.snowprofile::format_snowprofileLayers(...)
   5.         └─sarp.snowprofile::snowprofileLayers(validate = FALSE, dropNAs = FALSE)
   6.           ├─base::diff(sapply(entries[!is.na(entries)], length))
   7.           └─base::diff.default(sapply(entries[!is.na(entries)], length))
  ── Error ('test-dtwSP.R:5:3'): resampled, uneven (nL_q > nL_r), bottom.up (i.e., layer-tracking) ──
  Error in `r[i1] - r[if (lag < (len <- length(r))) -len:-(len - lag + 1L) else i0]`: non-numeric argument to binary operator
  Backtrace:
      ▆
   1. └─sarp.snowprofile.alignment::dtwSP(...) at test-dtwSP.R:5:3
   2.   └─sarp.snowprofile.alignment::resampleSP(ref, h = resamplingRate)
   3.     └─sarp.snowprofile::snowprofileLayers(...)
   4.       └─sarp.snowprofile::format_snowprofileLayers(...)
   5.         └─sarp.snowprofile::snowprofileLayers(validate = FALSE, dropNAs = FALSE)
   6.           ├─base::diff(sapply(entries[!is.na(entries)], length))
   7.           └─base::diff.default(sapply(entries[!is.na(entries)], length))
  ── Error ('test-dtwSP.R:16:3'): resampled, uneven (nL_q > nL_r), top.down ──────
  Error in `r[i1] - r[if (lag < (len <- length(r))) -len:-(len - lag + 1L) else i0]`: non-numeric argument to binary operator
  Backtrace:
      ▆
   1. └─sarp.snowprofile.alignment::dtwSP(...) at test-dtwSP.R:16:3
   2.   └─sarp.snowprofile.alignment::resampleSP(ref, h = resamplingRate)
   3.     └─sarp.snowprofile::snowprofileLayers(...)
   4.       └─sarp.snowprofile::format_snowprofileLayers(...)
   5.         └─sarp.snowprofile::snowprofileLayers(validate = FALSE, dropNAs = FALSE)
   6.           ├─base::diff(sapply(entries[!is.na(entries)], length))
   7.           └─base::diff.default(sapply(entries[!is.na(entries)], length))
  ── Error ('test-dtwSP.R:28:3'): resampled, uneven (nL_q < nL_r), bottom.up (i.e., layer-tracking) ──
  Error in `r[i1] - r[if (lag < (len <- length(r))) -len:-(len - lag + 1L) else i0]`: non-numeric argument to binary operator
  Backtrace:
      ▆
   1. └─sarp.snowprofile.alignment::dtwSP(...) at test-dtwSP.R:28:3
   2.   └─sarp.snowprofile.alignment::resampleSP(ref, h = resamplingRate)
   3.     └─sarp.snowprofile::snowprofileLayers(...)
   4.       └─sarp.snowprofile::format_snowprofileLayers(...)
   5.         └─sarp.snowprofile::snowprofileLayers(validate = FALSE, dropNAs = FALSE)
   6.           ├─base::diff(sapply(entries[!is.na(entries)], length))
   7.           └─base::diff.default(sapply(entries[!is.na(entries)], length))
  ── Error ('test-dtwSP.R:39:3'): resampled, uneven (nL_q < nL_r), top.down ──────
  Error in `r[i1] - r[if (lag < (len <- length(r))) -len:-(len - lag + 1L) else i0]`: non-numeric argument to binary operator
  Backtrace:
      ▆
   1. └─sarp.snowprofile.alignment::dtwSP(...) at test-dtwSP.R:39:3
   2.   └─sarp.snowprofile.alignment::resampleSP(ref, h = resamplingRate)
   3.     └─sarp.snowprofile::snowprofileLayers(...)
   4.       └─sarp.snowprofile::format_snowprofileLayers(...)
   5.         └─sarp.snowprofile::snowprofileLayers(validate = FALSE, dropNAs = FALSE)
   6.           ├─base::diff(sapply(entries[!is.na(entries)], length))
   7.           └─base::diff.default(sapply(entries[!is.na(entries)], length))
  ── Error ('test-dtwSP.R:51:3'): rescaled and resampled, top.down ───────────────
  Error in `r[i1] - r[if (lag < (len <- length(r))) -len:-(len - lag + 1L) else i0]`: non-numeric argument to binary operator
  Backtrace:
      ▆
   1. └─sarp.snowprofile.alignment::dtwSP(...) at test-dtwSP.R:51:3
   2.   └─sarp.snowprofile.alignment::resampleSP(ref, h = resamplingRate)
   3.     └─sarp.snowprofile::snowprofileLayers(...)
   4.       └─sarp.snowprofile::format_snowprofileLayers(...)
   5.         └─sarp.snowprofile::snowprofileLayers(validate = FALSE, dropNAs = FALSE)
   6.           ├─base::diff(sapply(entries[!is.na(entries)], length))
   7.           └─base::diff.default(sapply(entries[!is.na(entries)], length))
  ── Error ('test-dtwSP.R:74:3'): resampled, uneven, best match ──────────────────
  Error in `r[i1] - r[if (lag < (len <- length(r))) -len:-(len - lag + 1L) else i0]`: non-numeric argument to binary operator
  Backtrace:
      ▆
   1. └─sarp.snowprofile.alignment::dtwSP(...) at test-dtwSP.R:74:3
   2.   └─sarp.snowprofile.alignment::resampleSP(ref, h = resamplingRate)
   3.     └─sarp.snowprofile::snowprofileLayers(...)
   4.       └─sarp.snowprofile::format_snowprofileLayers(...)
   5.         └─sarp.snowprofile::snowprofileLayers(validate = FALSE, dropNAs = FALSE)
   6.           ├─base::diff(sapply(entries[!is.na(entries)], length))
   7.           └─base::diff.default(sapply(entries[!is.na(entries)], length))
  ── Error ('test-dtwSP.R:109:3'): resampled, uneven, bottom.up ──────────────────
  Error in `r[i1] - r[if (lag < (len <- length(r))) -len:-(len - lag + 1L) else i0]`: non-numeric argument to binary operator
  Backtrace:
      ▆
   1. └─sarp.snowprofile.alignment::dtwSP(...) at test-dtwSP.R:109:3
   2.   └─sarp.snowprofile.alignment::resampleSP(ref, h = resamplingRate)
   3.     └─sarp.snowprofile::snowprofileLayers(...)
   4.       └─sarp.snowprofile::format_snowprofileLayers(...)
   5.         └─sarp.snowprofile::snowprofileLayers(validate = FALSE, dropNAs = FALSE)
   6.           ├─base::diff(sapply(entries[!is.na(entries)], length))
   7.           └─base::diff.default(sapply(entries[!is.na(entries)], length))
  ── Error ('test-dtwSP.R:122:3'): resampled, uneven, top.down, unobservedBasalLayer, warp:jminTopDown ──
  Error in `r[i1] - r[if (lag < (len <- length(r))) -len:-(len - lag + 1L) else i0]`: non-numeric argument to binary operator
  Backtrace:
      ▆
   1. └─sarp.snowprofile.alignment::dtwSP(...) at test-dtwSP.R:122:3
   2.   └─sarp.snowprofile.alignment::resampleSP(ref, h = resamplingRate)
   3.     └─sarp.snowprofile::snowprofileLayers(...)
   4.       └─sarp.snowprofile::format_snowprofileLayers(...)
   5.         └─sarp.snowprofile::snowprofileLayers(validate = FALSE, dropNAs = FALSE)
   6.           ├─base::diff(sapply(entries[!is.na(entries)], length))
   7.           └─base::diff.default(sapply(entries[!is.na(entries)], length))
  
  [ FAIL 9 | WARN 0 | SKIP 0 | PASS 0 ]
  Error:
  ! Test failures.
  Execution halted