Last updated on 2025-11-05 03:50:17 CET.
| Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
|---|---|---|---|---|---|---|
| r-devel-linux-x86_64-debian-clang | 0.3.10 | 51.27 | 215.61 | 266.88 | OK | |
| r-devel-linux-x86_64-debian-gcc | 0.3.10 | 37.01 | 142.75 | 179.76 | OK | |
| r-devel-linux-x86_64-fedora-clang | 0.3.10 | 80.00 | 362.95 | 442.95 | ERROR | |
| r-devel-linux-x86_64-fedora-gcc | 0.3.10 | 73.00 | 358.40 | 431.40 | ERROR | |
| r-devel-windows-x86_64 | 0.3.10 | 67.00 | 282.00 | 349.00 | OK | |
| r-patched-linux-x86_64 | 0.3.10 | 56.45 | 233.84 | 290.29 | OK | |
| r-release-linux-x86_64 | 0.3.10 | 52.82 | 232.52 | 285.34 | OK | |
| r-release-macos-arm64 | 0.3.10 | 20.00 | 81.00 | 101.00 | OK | |
| r-release-macos-x86_64 | 0.3.10 | 28.00 | 184.00 | 212.00 | OK | |
| r-release-windows-x86_64 | 0.3.10 | 64.00 | 283.00 | 347.00 | OK | |
| r-oldrel-macos-arm64 | 0.3.10 | 18.00 | 86.00 | 104.00 | OK | |
| r-oldrel-macos-x86_64 | 0.3.10 | 28.00 | 207.00 | 235.00 | OK | |
| r-oldrel-windows-x86_64 | 0.3.10 | 75.00 | 352.00 | 427.00 | OK |
Version: 0.3.10
Check: examples
Result: ERROR
Running examples in ‘phenofit-Ex.R’ failed
The error most likely occurred in:
> ### Name: roughFit
> ### Title: Rough fitting
> ### Aliases: roughFit
> ### Keywords: internal
>
> ### ** Examples
>
> data("CA_NS6")
> d <- CA_NS6
>
> nptperyear <- 23
> INPUT <- check_input(d$t, d$y, d$w,
+ QC_flag = d$QC_flag,
+ nptperyear = nptperyear, south = FALSE,
+ maxgap = nptperyear / 4, alpha = 0.02, wmin = 0.2
+ )
> # plot_input(INPUT)
>
> wFUN <- "wTSM"
> # all year as a whole
> options = list(rFUN = "smooth_wWHIT", wFUN = wFUN, lambda = 10)
> brks <- season(INPUT, lambda = 10)
> plot_season(INPUT, brks, d)
>
> brks2 = season_input(INPUT, options)
> all.equal(brks2, brks)
[1] TRUE
>
> c(d_fit, info_peak) %<-% roughFit(INPUT)
> d_season = find_season.peaks(d_fit, info_peak)
>
> c(t, ypred) %<-% d_fit[, .(t, ziter2)]
> d_season = find_season.default(ypred, t)
> all.equal(brks$dt, d_season)
[1] TRUE
>
> # opt <- .options$season
> # brks$fit - d_fit # function passed test
>
> # curve fitting by year
> brks_mov <- season_mov(INPUT,
+ options = list(
+ rFUN = "smooth_wWHIT", wFUN = wFUN,
+ lambda = 10,
+ r_min = 0.05, ypeak_min = 0.05,
+ verbose = TRUE
+ )
+ )
[season_mov] running 1 ...
iloop = 1: lambda = 10.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 2: lambda = 5.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 3: lambda = 2.5, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
[season_mov] running 2 ...
iloop = 1: lambda = 10.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 2: lambda = 5.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 3: lambda = 2.5, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
[season_mov] running 3 ...
iloop = 1: lambda = 10.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 2: lambda = 5.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 3: lambda = 2.5, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
[season_mov] running 4 ...
iloop = 1: lambda = 10.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 2: lambda = 5.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 3: lambda = 2.5, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
[season_mov] running 5 ...
iloop = 1: lambda = 10.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 2: lambda = 5.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 3: lambda = 2.5, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
[season_mov] running 6 ...
iloop = 1: lambda = 10.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 2: lambda = 5.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 3: lambda = 2.5, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
[season_mov] running 7 ...
iloop = 1: lambda = 10.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 2: lambda = 5.0, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
iloop = 3: lambda = 2.5, ntrough_PerYear = 0.00, npeak_PerYear = 0.00
> plot_season(INPUT, brks_mov)
>
> rfit <- brks2rfit(brks_mov)
> r <- get_pheno(rfit)
Error in `str_replace_all()`:
! Failed to apply `replacement` function.
ℹ It must accept a character vector of any length.
Caused by error in `rep()`:
! invalid 'times' argument
Backtrace:
▆
1. ├─phenofit::get_pheno(rfit)
2. ├─phenofit:::get_pheno.rfit(rfit)
3. │ └─... %>% set_names(dt$flag)
4. ├─dplyr::group_map(...)
5. ├─dplyr:::group_map.data.frame(...)
6. │ └─dplyr:::map2(chunks, group_keys, .f, ...)
7. │ └─base::mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE)
8. │ └─phenofit (local) `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]])
9. │ └─phenofit:::PhenoDeriv.default(values, t, der1, IsPlot = FALSE)
10. │ └─phenofit::findpeaks(...)
11. │ └─xc %<>% str_replace_midzero()
12. ├─phenofit:::str_replace_midzero(.)
13. │ └─str_replace_all(x, "\\++0\\++", . %>% replace("+")) %>% ...
14. ├─stringr::str_replace_all(., "-+0-+", . %>% replace("-"))
15. │ └─stringr:::str_transform_all(string, pattern, replacement)
16. │ ├─base::withCallingHandlers(...)
17. │ └─magrittr (local) replacement(old_flat)
18. │ └─magrittr::freduce(value, `_function_list`)
19. │ ├─base::withVisible(function_list[[k]](value))
20. │ └─function_list[[k]](value)
21. │ └─phenofit (local) replace(., "-")
22. │ └─base::paste(rep(replacement, nchar(x)), collapse = "")
23. └─base::.handleSimpleError(...)
24. └─stringr (local) h(simpleError(msg, call))
25. └─cli::cli_abort(...)
26. └─rlang::abort(...)
Execution halted
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc
Version: 0.3.10
Check: tests
Result: ERROR
Running ‘testthat.R’ [93s/95s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(phenofit)
>
> test_check("phenofit")
List of 5
$ AG : tibble [6 × 8] (S3: tbl_df/tbl/data.frame)
$ Beck : tibble [6 × 7] (S3: tbl_df/tbl/data.frame)
$ Elmore: tibble [6 × 8] (S3: tbl_df/tbl/data.frame)
$ Gu : tibble [6 × 10] (S3: tbl_df/tbl/data.frame)
$ Zhang : tibble [6 × 8] (S3: tbl_df/tbl/data.frame)
NULL
# A tibble: 6 × 8
flag t0 mn mx rsp a3 rau a5
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1999_1 -135. 0.201 0.636 0.00932 2.85 0.00852 2
2 2000_1 189. 0.238 0.635 0.0126 2.47 0.00801 3.21
3 2001_1 569. 0.252 0.626 0.0108 2.96 0.00950 2.96
4 2002_1 892. 0.253 0.614 0.0159 2 0.00724 3.08
5 2003_1 1268. 0.236 0.577 0.0121 2.88 0.00723 2.88
6 2004_1 1676. 0.202 0.576 0.00839 2.81 0.00980 3.52
meth R2 NSE R RMSE pvalue n_sim
<char> <num> <num> <num> <num> <num> <num>
1: AG 0.9986908 0.9985845 0.9993452 9.940385e-03 4.489925e-65 46
2: Beck 1.0000000 1.0000000 1.0000000 4.932917e-10 0.000000e+00 46
3: Elmore 1.0000000 1.0000000 1.0000000 3.945072e-10 0.000000e+00 46
4: Gu 1.0000000 1.0000000 1.0000000 8.389241e-10 0.000000e+00 46
5: Zhang 1.0000000 1.0000000 1.0000000 5.529117e-06 8.044939e-208 46
$AG
formula: mn + (mx - mn) * exp(-((t0 - t) * rsp)^a3)
formula: mn + (mx - mn) * exp(-((t - t0) * rau)^a5)
pars:
t0 mn mx rsp a3 rau a5
nlminb 149.8926 0.1020656 0.7095242 0.009389263 6 0.009367765 6
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 1.65502e-16); attempting approx solution
warning: solve(): system is singular (rcond: 2.19427e-17); attempting approx solution
warning: solve(): system is singular (rcond: 1.65502e-16); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 1.33432e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 2.38811e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 2.03034e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 1.33432e-17); attempting approx solution
warning: solve(): system is singular (rcond: 3.31005e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 3.08395e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 2.36432e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 6.97437e-18); attempting approx solution
[ FAIL 2 | WARN 2 | SKIP 0 | PASS 66 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-PhenoExtract.R:63:5'): get_pheno.rfit works ────────────────────
Error in `str_replace_all(x, "\\++0\\++", . %>% replace("+"))`: Failed to apply `replacement` function.
ℹ It must accept a character vector of any length.
Caused by error in `rep()`:
! invalid 'times' argument
Backtrace:
▆
1. ├─phenofit::get_pheno(rfit) at test-PhenoExtract.R:63:5
2. ├─phenofit:::get_pheno.rfit(rfit)
3. │ └─... %>% set_names(dt$flag)
4. ├─dplyr::group_map(...)
5. ├─dplyr:::group_map.data.frame(...)
6. │ └─dplyr:::map2(chunks, group_keys, .f, ...)
7. │ └─base::mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE)
8. │ └─phenofit (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
9. │ └─phenofit:::PhenoDeriv.default(values, t, der1, IsPlot = FALSE)
10. │ └─phenofit::findpeaks(...)
11. │ └─xc %<>% str_replace_midzero()
12. ├─phenofit:::str_replace_midzero(.)
13. │ ├─str_replace_all(x, "\\++0\\++", . %>% replace("+")) %>% ...
14. │ └─stringr::str_replace_all(x, "\\++0\\++", . %>% replace("+"))
15. │ └─stringr:::str_transform_all(string, pattern, replacement)
16. │ ├─base::withCallingHandlers(...)
17. │ └─magrittr (local) replacement(old_flat)
18. │ └─magrittr::freduce(value, `_function_list`)
19. │ ├─base::withVisible(function_list[[k]](value))
20. │ └─function_list[[k]](value)
21. │ └─phenofit (local) replace(., "+")
22. │ └─base::paste(rep(replacement, nchar(x)), collapse = "")
23. ├─stringr::str_replace_all(., "-+0-+", . %>% replace("-"))
24. │ └─stringr:::str_transform_all(string, pattern, replacement)
25. │ └─stringr::str_locate_all(string, pattern)
26. │ └─stringr:::check_lengths(string, pattern)
27. │ └─vctrs::vec_size_common(...)
28. └─base::.handleSimpleError(...)
29. └─stringr (local) h(simpleError(msg, call))
30. └─cli::cli_abort(...)
31. └─rlang::abort(...)
── Error ('test-season.R:34:5'): `season` with smooth_wSG ──────────────────────
Error in `str_replace_all(., "-+0-+", . %>% replace("-"))`: Failed to apply `replacement` function.
ℹ It must accept a character vector of any length.
Caused by error in `rep()`:
! invalid 'times' argument
Backtrace:
▆
1. ├─testthat::expect_silent(brks <- do.call(season, param)) at test-season.R:34:5
2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
3. │ ├─testthat (local) .capture(...)
4. │ │ ├─withr::with_output_sink(...)
5. │ │ │ └─base::force(code)
6. │ │ ├─base::withCallingHandlers(...)
7. │ │ └─base::withVisible(code)
8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
9. ├─base::do.call(season, param)
10. ├─phenofit (local) `<fn>`(...)
11. │ └─phenofit:::findpeaks_season(...)
12. │ └─phenofit::findpeaks(...)
13. │ └─xc %<>% str_replace_midzero()
14. ├─phenofit:::str_replace_midzero(.)
15. │ └─str_replace_all(x, "\\++0\\++", . %>% replace("+")) %>% ...
16. ├─stringr::str_replace_all(., "-+0-+", . %>% replace("-"))
17. │ └─stringr:::str_transform_all(string, pattern, replacement)
18. │ ├─base::withCallingHandlers(...)
19. │ └─magrittr (local) replacement(old_flat)
20. │ └─magrittr::freduce(value, `_function_list`)
21. │ ├─base::withVisible(function_list[[k]](value))
22. │ └─function_list[[k]](value)
23. │ └─phenofit (local) replace(., "-")
24. │ └─base::paste(rep(replacement, nchar(x)), collapse = "")
25. └─base::.handleSimpleError(...)
26. └─stringr (local) h(simpleError(msg, call))
27. └─cli::cli_abort(...)
28. └─rlang::abort(...)
[ FAIL 2 | WARN 2 | SKIP 0 | PASS 66 ]
Error: Test failures
Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang
Version: 0.3.10
Check: tests
Result: ERROR
Running ‘testthat.R’ [87s/89s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(phenofit)
>
> test_check("phenofit")
List of 5
$ AG : tibble [6 × 8] (S3: tbl_df/tbl/data.frame)
$ Beck : tibble [6 × 7] (S3: tbl_df/tbl/data.frame)
$ Elmore: tibble [6 × 8] (S3: tbl_df/tbl/data.frame)
$ Gu : tibble [6 × 10] (S3: tbl_df/tbl/data.frame)
$ Zhang : tibble [6 × 8] (S3: tbl_df/tbl/data.frame)
NULL
# A tibble: 6 × 8
flag t0 mn mx rsp a3 rau a5
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1999_1 -135. 0.201 0.636 0.00932 2.85 0.00852 2
2 2000_1 189. 0.238 0.635 0.0126 2.47 0.00801 3.21
3 2001_1 569. 0.252 0.626 0.0108 2.96 0.00950 2.96
4 2002_1 892. 0.253 0.614 0.0159 2 0.00724 3.08
5 2003_1 1268. 0.236 0.577 0.0121 2.88 0.00723 2.88
6 2004_1 1676. 0.202 0.576 0.00839 2.81 0.00980 3.52
meth R2 NSE R RMSE pvalue n_sim
<char> <num> <num> <num> <num> <num> <num>
1: AG 0.9986908 0.9985845 0.9993452 9.940385e-03 4.489925e-65 46
2: Beck 1.0000000 1.0000000 1.0000000 4.932917e-10 0.000000e+00 46
3: Elmore 1.0000000 1.0000000 1.0000000 3.945072e-10 0.000000e+00 46
4: Gu 1.0000000 1.0000000 1.0000000 8.389241e-10 0.000000e+00 46
5: Zhang 1.0000000 1.0000000 1.0000000 5.529117e-06 8.044939e-208 46
$AG
formula: mn + (mx - mn) * exp(-((t0 - t) * rsp)^a3)
formula: mn + (mx - mn) * exp(-((t - t0) * rau)^a5)
pars:
t0 mn mx rsp a3 rau a5
nlminb 149.8926 0.1020656 0.7095242 0.009389263 6 0.009367765 6
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 1.65502e-16); attempting approx solution
warning: solve(): system is singular (rcond: 2.19427e-17); attempting approx solution
warning: solve(): system is singular (rcond: 1.65502e-16); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 1.33432e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 2.38811e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 2.03034e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 1.33432e-17); attempting approx solution
warning: solve(): system is singular (rcond: 3.31005e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 3.08395e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 2.36432e-17); attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular; attempting approx solution
warning: solve(): system is singular (rcond: 6.97437e-18); attempting approx solution
[ FAIL 2 | WARN 2 | SKIP 0 | PASS 66 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-PhenoExtract.R:63:5'): get_pheno.rfit works ────────────────────
Error in `str_replace_all(x, "\\++0\\++", . %>% replace("+"))`: Failed to apply `replacement` function.
ℹ It must accept a character vector of any length.
Caused by error in `rep()`:
! invalid 'times' argument
Backtrace:
▆
1. ├─phenofit::get_pheno(rfit) at test-PhenoExtract.R:63:5
2. ├─phenofit:::get_pheno.rfit(rfit)
3. │ └─... %>% set_names(dt$flag)
4. ├─dplyr::group_map(...)
5. ├─dplyr:::group_map.data.frame(...)
6. │ └─dplyr:::map2(chunks, group_keys, .f, ...)
7. │ └─base::mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE)
8. │ └─phenofit (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
9. │ └─phenofit:::PhenoDeriv.default(values, t, der1, IsPlot = FALSE)
10. │ └─phenofit::findpeaks(...)
11. │ └─xc %<>% str_replace_midzero()
12. ├─phenofit:::str_replace_midzero(.)
13. │ ├─str_replace_all(x, "\\++0\\++", . %>% replace("+")) %>% ...
14. │ └─stringr::str_replace_all(x, "\\++0\\++", . %>% replace("+"))
15. │ └─stringr:::str_transform_all(string, pattern, replacement)
16. │ ├─base::withCallingHandlers(...)
17. │ └─magrittr (local) replacement(old_flat)
18. │ └─magrittr::freduce(value, `_function_list`)
19. │ ├─base::withVisible(function_list[[k]](value))
20. │ └─function_list[[k]](value)
21. │ └─phenofit (local) replace(., "+")
22. │ └─base::paste(rep(replacement, nchar(x)), collapse = "")
23. ├─stringr::str_replace_all(., "-+0-+", . %>% replace("-"))
24. │ └─stringr:::str_transform_all(string, pattern, replacement)
25. │ └─stringr::str_locate_all(string, pattern)
26. │ └─stringr:::check_lengths(string, pattern)
27. │ └─vctrs::vec_size_common(...)
28. └─base::.handleSimpleError(...)
29. └─stringr (local) h(simpleError(msg, call))
30. └─cli::cli_abort(...)
31. └─rlang::abort(...)
── Error ('test-season.R:34:5'): `season` with smooth_wSG ──────────────────────
Error in `str_replace_all(., "-+0-+", . %>% replace("-"))`: Failed to apply `replacement` function.
ℹ It must accept a character vector of any length.
Caused by error in `rep()`:
! invalid 'times' argument
Backtrace:
▆
1. ├─testthat::expect_silent(brks <- do.call(season, param)) at test-season.R:34:5
2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
3. │ ├─testthat (local) .capture(...)
4. │ │ ├─withr::with_output_sink(...)
5. │ │ │ └─base::force(code)
6. │ │ ├─base::withCallingHandlers(...)
7. │ │ └─base::withVisible(code)
8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
9. ├─base::do.call(season, param)
10. ├─phenofit (local) `<fn>`(...)
11. │ └─phenofit:::findpeaks_season(...)
12. │ └─phenofit::findpeaks(...)
13. │ └─xc %<>% str_replace_midzero()
14. ├─phenofit:::str_replace_midzero(.)
15. │ └─str_replace_all(x, "\\++0\\++", . %>% replace("+")) %>% ...
16. ├─stringr::str_replace_all(., "-+0-+", . %>% replace("-"))
17. │ └─stringr:::str_transform_all(string, pattern, replacement)
18. │ ├─base::withCallingHandlers(...)
19. │ └─magrittr (local) replacement(old_flat)
20. │ └─magrittr::freduce(value, `_function_list`)
21. │ ├─base::withVisible(function_list[[k]](value))
22. │ └─function_list[[k]](value)
23. │ └─phenofit (local) replace(., "-")
24. │ └─base::paste(rep(replacement, nchar(x)), collapse = "")
25. └─base::.handleSimpleError(...)
26. └─stringr (local) h(simpleError(msg, call))
27. └─cli::cli_abort(...)
28. └─rlang::abort(...)
[ FAIL 2 | WARN 2 | SKIP 0 | PASS 66 ]
Error: Test failures
Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc