* using log directory 'd:/Rcompile/CRANpkg/local/4.0/hydropeak.Rcheck' * using R version 4.0.5 (2021-03-31) * using platform: x86_64-w64-mingw32 (64-bit) * using session charset: ISO8859-1 * checking for file 'hydropeak/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'hydropeak' version '0.1.0' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'hydropeak' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking 'build' directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [2s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of 'data' directory ... OK * checking data for non-ASCII characters ... OK * checking data for ASCII and uncompressed saves ... OK * checking installed files from 'inst/doc' ... OK * checking files in 'vignettes' ... OK * checking examples ... [0s] ERROR Running examples in 'hydropeak-Ex.R' failed The error most likely occurred in: > ### Name: all_metrics > ### Title: Event Based Fluctuation Flow Parameters > ### Aliases: all_metrics > > ### ** Examples > > data(Q) > # decreasing event: > Q4 <- flow(Q[3:4, ]) Error in unique.default(x, nmax = nmax) : unique() applies only to vectors Calls: flow ... split.default -> as.factor -> factor -> unique -> unique.default Execution halted * checking for unstated dependencies in 'tests' ... OK * checking tests ... [2s] ERROR Running 'testthat.R' [2s] Running the tests in 'tests/testthat.R' failed. Complete output: > library("testthat") > library("hydropeak") > > test_check("hydropeak") [ FAIL 12 | WARN 0 | SKIP 0 | PASS 2 ] == 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) at 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) at 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) at 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) at 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) at 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) at 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) at 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) at 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) at 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") at 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(...) at 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) at 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 * checking for unstated dependencies in vignettes ... OK * checking package vignettes in 'inst/doc' ... OK * checking re-building of vignette outputs ... [2s] WARNING Error(s) in re-building vignettes: --- re-building 'hydropeak-intro.Rmd' using rmarkdown Quitting from lines 57-61 (hydropeak-intro.Rmd) Error: processing vignette 'hydropeak-intro.Rmd' failed with diagnostics: unique() applies only to vectors --- failed re-building 'hydropeak-intro.Rmd' SUMMARY: processing the following file failed: 'hydropeak-intro.Rmd' Error: Vignette re-building failed. Execution halted * checking PDF version of manual ... OK * DONE Status: 2 ERRORs, 1 WARNING