Running 'testthat.R' [2s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library("testthat")
  > library("hydropeak")
  > 
  > test_check("hydropeak")
  == Failed tests ================================================================
  -- Error (test-events.R:10:3): metrics are computed correctly (start with DC event) --
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. +-testthat::expect_equal(get_events(testQ), testEvents, ignore_attr = TRUE) test-events.R:10:2
    2. | \-testthat::quasi_label(enquo(object), label, arg = "object")
    3. |   \-rlang::eval_bare(expr, quo_get_env(quo))
    4. \-hydropeak::get_events(testQ)
    5.   \-hydropeak::flow(x, ...)
    6.     +-hydropeak::validate_flow(...)
    7.     | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    8.     | +-c("ID", "Time", "Q") %in% colnames(x)
    9.     | \-base::colnames(x)
   10.     |   \-base::is.data.frame(x)
   11.     \-hydropeak:::new_flow(...)
   12.       \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
   13.         +-base::split(x, ~ID)
   14.         \-base::split.data.frame(x, ~ID)
   15.           +-base::lapply(...)
   16.           +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   17.           \-base::split.default(...)
   18.             \-base::as.factor(f)
   19.               \-base::factor(x)
   20.                 +-base::unique(x, nmax = nmax)
   21.                 \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:20:3): metrics are computed correctly (gauging station ID change) --
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. +-testthat::expect_equal(get_events(testQ), testEvents, ignore_attr = TRUE) test-events.R:20:2
    2. | \-testthat::quasi_label(enquo(object), label, arg = "object")
    3. |   \-rlang::eval_bare(expr, quo_get_env(quo))
    4. \-hydropeak::get_events(testQ)
    5.   \-hydropeak::flow(x, ...)
    6.     +-hydropeak::validate_flow(...)
    7.     | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    8.     | +-c("ID", "Time", "Q") %in% colnames(x)
    9.     | \-base::colnames(x)
   10.     |   \-base::is.data.frame(x)
   11.     \-hydropeak:::new_flow(...)
   12.       \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
   13.         +-base::split(x, ~ID)
   14.         \-base::split.data.frame(x, ~ID)
   15.           +-base::lapply(...)
   16.           +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   17.           \-base::split.default(...)
   18.             \-base::as.factor(f)
   19.               \-base::factor(x)
   20.                 +-base::unique(x, nmax = nmax)
   21.                 \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:26:3): change points are computed correctly ------------
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. \-hydropeak::flow(testQ) test-events.R:26:2
    2.   +-hydropeak::validate_flow(...)
    3.   | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    4.   | +-c("ID", "Time", "Q") %in% colnames(x)
    5.   | \-base::colnames(x)
    6.   |   \-base::is.data.frame(x)
    7.   \-hydropeak:::new_flow(...)
    8.     \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
    9.       +-base::split(x, ~ID)
   10.       \-base::split.data.frame(x, ~ID)
   11.         +-base::lapply(...)
   12.         +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   13.         \-base::split.default(...)
   14.           \-base::as.factor(f)
   15.             \-base::factor(x)
   16.               +-base::unique(x, nmax = nmax)
   17.               \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:38:3): change points are computed correctly including constant event --
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. \-hydropeak::flow(testQ) test-events.R:38:2
    2.   +-hydropeak::validate_flow(...)
    3.   | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    4.   | +-c("ID", "Time", "Q") %in% colnames(x)
    5.   | \-base::colnames(x)
    6.   |   \-base::is.data.frame(x)
    7.   \-hydropeak:::new_flow(...)
    8.     \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
    9.       +-base::split(x, ~ID)
   10.       \-base::split.data.frame(x, ~ID)
   11.         +-base::lapply(...)
   12.         +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   13.         \-base::split.default(...)
   14.           \-base::as.factor(f)
   15.             \-base::factor(x)
   16.               +-base::unique(x, nmax = nmax)
   17.               \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:50:3): change points are computed correctly including constant and na event --
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. \-hydropeak::flow(testQ) test-events.R:50:2
    2.   +-hydropeak::validate_flow(...)
    3.   | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    4.   | +-c("ID", "Time", "Q") %in% colnames(x)
    5.   | \-base::colnames(x)
    6.   |   \-base::is.data.frame(x)
    7.   \-hydropeak:::new_flow(...)
    8.     \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
    9.       +-base::split(x, ~ID)
   10.       \-base::split.data.frame(x, ~ID)
   11.         +-base::lapply(...)
   12.         +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   13.         \-base::split.default(...)
   14.           \-base::as.factor(f)
   15.             \-base::factor(x)
   16.               +-base::unique(x, nmax = nmax)
   17.               \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:62:3): assigned DC event -------------------------------
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. \-hydropeak::flow(testQ) test-events.R:62:2
    2.   +-hydropeak::validate_flow(...)
    3.   | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    4.   | +-c("ID", "Time", "Q") %in% colnames(x)
    5.   | \-base::colnames(x)
    6.   |   \-base::is.data.frame(x)
    7.   \-hydropeak:::new_flow(...)
    8.     \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
    9.       +-base::split(x, ~ID)
   10.       \-base::split.data.frame(x, ~ID)
   11.         +-base::lapply(...)
   12.         +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   13.         \-base::split.default(...)
   14.           \-base::as.factor(f)
   15.             \-base::factor(x)
   16.               +-base::unique(x, nmax = nmax)
   17.               \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:70:3): assigned IC event -------------------------------
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. \-hydropeak::flow(testQ) test-events.R:70:2
    2.   +-hydropeak::validate_flow(...)
    3.   | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    4.   | +-c("ID", "Time", "Q") %in% colnames(x)
    5.   | \-base::colnames(x)
    6.   |   \-base::is.data.frame(x)
    7.   \-hydropeak:::new_flow(...)
    8.     \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
    9.       +-base::split(x, ~ID)
   10.       \-base::split.data.frame(x, ~ID)
   11.         +-base::lapply(...)
   12.         +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   13.         \-base::split.default(...)
   14.           \-base::as.factor(f)
   15.             \-base::factor(x)
   16.               +-base::unique(x, nmax = nmax)
   17.               \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:78:3): assigned constant event 0 -----------------------
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. \-hydropeak::flow(testQ) test-events.R:78:2
    2.   +-hydropeak::validate_flow(...)
    3.   | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    4.   | +-c("ID", "Time", "Q") %in% colnames(x)
    5.   | \-base::colnames(x)
    6.   |   \-base::is.data.frame(x)
    7.   \-hydropeak:::new_flow(...)
    8.     \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
    9.       +-base::split(x, ~ID)
   10.       \-base::split.data.frame(x, ~ID)
   11.         +-base::lapply(...)
   12.         +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   13.         \-base::split.default(...)
   14.           \-base::as.factor(f)
   15.             \-base::factor(x)
   16.               +-base::unique(x, nmax = nmax)
   17.               \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:85:3): assigned NA event 5 -----------------------------
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. \-hydropeak::flow(testQ) test-events.R:85:2
    2.   +-hydropeak::validate_flow(...)
    3.   | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    4.   | +-c("ID", "Time", "Q") %in% colnames(x)
    5.   | \-base::colnames(x)
    6.   |   \-base::is.data.frame(x)
    7.   \-hydropeak:::new_flow(...)
    8.     \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
    9.       +-base::split(x, ~ID)
   10.       \-base::split.data.frame(x, ~ID)
   11.         +-base::lapply(...)
   12.         +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   13.         \-base::split.default(...)
   14.           \-base::as.factor(f)
   15.             \-base::factor(x)
   16.               +-base::unique(x, nmax = nmax)
   17.               \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:92:3): output type of get_events() is a list (data.frame) --
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. +-testthat::expect_type(get_events(Q[1:10, ]), "list") test-events.R:92:2
    2. | \-testthat::quasi_label(enquo(object), arg = "object")
    3. |   \-rlang::eval_bare(expr, quo_get_env(quo))
    4. \-hydropeak::get_events(Q[1:10, ])
    5.   \-hydropeak::flow(x, ...)
    6.     +-hydropeak::validate_flow(...)
    7.     | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    8.     | +-c("ID", "Time", "Q") %in% colnames(x)
    9.     | \-base::colnames(x)
   10.     |   \-base::is.data.frame(x)
   11.     \-hydropeak:::new_flow(...)
   12.       \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
   13.         +-base::split(x, ~ID)
   14.         \-base::split.data.frame(x, ~ID)
   15.           +-base::lapply(...)
   16.           +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   17.           \-base::split.default(...)
   18.             \-base::as.factor(f)
   19.               \-base::factor(x)
   20.                 +-base::unique(x, nmax = nmax)
   21.                 \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:97:3): column names of output of get_events() equal specific names --
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. +-testthat::expect_named(...) test-events.R:97:2
    2. | \-testthat::quasi_label(enquo(object), label, arg = "object")
    3. |   \-rlang::eval_bare(expr, quo_get_env(quo))
    4. \-hydropeak::get_events(Q[1:10, ])
    5.   \-hydropeak::flow(x, ...)
    6.     +-hydropeak::validate_flow(...)
    7.     | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    8.     | +-c("ID", "Time", "Q") %in% colnames(x)
    9.     | \-base::colnames(x)
   10.     |   \-base::is.data.frame(x)
   11.     \-hydropeak:::new_flow(...)
   12.       \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
   13.         +-base::split(x, ~ID)
   14.         \-base::split.data.frame(x, ~ID)
   15.           +-base::lapply(...)
   16.           +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   17.           \-base::split.default(...)
   18.             \-base::as.factor(f)
   19.               \-base::factor(x)
   20.                 +-base::unique(x, nmax = nmax)
   21.                 \-base::unique.default(x, nmax = nmax)
  -- Error (test-events.R:102:3): no duplicates in time series -------------------
  Error in `unique.default(x, nmax = nmax)`: unique() applies only to vectors
  Backtrace:
       x
    1. \-hydropeak::get_events(Q) test-events.R:102:2
    2.   \-hydropeak::flow(x, ...)
    3.     +-hydropeak::validate_flow(...)
    4.     | +-base::stopifnot(all(c("ID", "Time", "Q") %in% colnames(x)))
    5.     | +-c("ID", "Time", "Q") %in% colnames(x)
    6.     | \-base::colnames(x)
    7.     |   \-base::is.data.frame(x)
    8.     \-hydropeak:::new_flow(...)
    9.       \-hydropeak:::impute_flow(x, format = format, tz = tz, steplength = steplength)
   10.         +-base::split(x, ~ID)
   11.         \-base::split.data.frame(x, ~ID)
   12.           +-base::lapply(...)
   13.           +-base::split(x = seq_len(nrow(x)), f = f, drop = drop, ...)
   14.           \-base::split.default(...)
   15.             \-base::as.factor(f)
   16.               \-base::factor(x)
   17.                 +-base::unique(x, nmax = nmax)
   18.                 \-base::unique.default(x, nmax = nmax)
  
  [ FAIL 12 | WARN 0 | SKIP 0 | PASS 2 ]
  Error: Test failures
  Execution halted