Last updated on 2025-12-04 09:50:02 CET.
| Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
|---|---|---|---|---|---|---|
| r-devel-linux-x86_64-debian-clang | 0.3.10 | 49.84 | 211.58 | 261.42 | ERROR | |
| r-devel-linux-x86_64-debian-gcc | 0.3.10 | 36.50 | 142.31 | 178.81 | ERROR | |
| r-devel-linux-x86_64-fedora-clang | 0.3.10 | 117.00 | 321.87 | 438.87 | ERROR | |
| r-devel-linux-x86_64-fedora-gcc | 0.3.10 | 113.00 | 306.92 | 419.92 | ERROR | |
| r-devel-windows-x86_64 | 0.3.10 | 64.00 | 300.00 | 364.00 | ERROR | |
| r-patched-linux-x86_64 | 0.3.10 | 56.71 | 229.77 | 286.48 | ERROR | |
| r-release-linux-x86_64 | 0.3.10 | 56.47 | 231.78 | 288.25 | ERROR | |
| r-release-macos-arm64 | 0.3.10 | OK | ||||
| r-release-macos-x86_64 | 0.3.10 | 28.00 | 184.00 | 212.00 | OK | |
| r-release-windows-x86_64 | 0.3.10 | 66.00 | 301.00 | 367.00 | ERROR | |
| r-oldrel-macos-arm64 | 0.3.10 | OK | ||||
| r-oldrel-macos-x86_64 | 0.3.10 | 28.00 | 207.00 | 235.00 | OK | |
| r-oldrel-windows-x86_64 | 0.3.10 | 79.00 | 348.00 | 427.00 | ERROR |
Version: 0.3.10
Check: examples
Result: ERROR
Running examples in ‘phenofit-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### 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
Examples with CPU (user + system) or elapsed time > 5s
user system elapsed
curvefits 4.193 0.106 5.131
plot_curvefits 3.874 0.060 5.081
Flavor: r-devel-linux-x86_64-debian-clang
Version: 0.3.10
Check: tests
Result: ERROR
Running ‘testthat.R’ [54s/61s]
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
Saving _problems/test-PhenoExtract-63.R
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.315171e-11 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-debian-clang
Version: 0.3.10
Check: examples
Result: ERROR
Running examples in ‘phenofit-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### 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
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 0.3.10
Check: tests
Result: ERROR
Running ‘testthat.R’ [35s/41s]
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
Saving _problems/test-PhenoExtract-63.R
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.315171e-11 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-debian-gcc
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, r-devel-windows-x86_64, r-release-windows-x86_64, r-oldrel-windows-x86_64
Version: 0.3.10
Check: tests
Result: ERROR
Running ‘testthat.R’ [90s/101s]
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
Saving _problems/test-PhenoExtract-63.R
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’ [83s/112s]
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
Saving _problems/test-PhenoExtract-63.R
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
Version: 0.3.10
Check: tests
Result: ERROR
Running 'testthat.R' [82s]
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 1677. 0.202 0.576 0.00832 2.84 0.00990 3.48
Saving _problems/test-PhenoExtract-63.R
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 1.389780e-09 0.000000e+00 46
3: Elmore 1.0000000 1.0000000 1.0000000 4.161813e-10 0.000000e+00 46
4: Gu 1.0000000 1.0000000 1.0000000 1.536880e-11 0.000000e+00 46
5: Zhang 1.0000000 1.0000000 1.0000000 5.529073e-06 8.043461e-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-windows-x86_64
Version: 0.3.10
Check: examples
Result: ERROR
Running examples in ‘phenofit-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### 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
Examples with CPU (user + system) or elapsed time > 5s
user system elapsed
curvefits 4.938 0.098 6.035
plot_curvefits 4.473 0.032 5.468
Flavor: r-patched-linux-x86_64
Version: 0.3.10
Check: tests
Result: ERROR
Running ‘testthat.R’ [75s/101s]
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 1677. 0.202 0.576 0.00832 2.84 0.00990 3.48
Saving _problems/test-PhenoExtract-63.R
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 1.389780e-09 0.000000e+00 46
3: Elmore 1.0000000 1.0000000 1.0000000 4.161813e-10 0.000000e+00 46
4: Gu 1.0000000 1.0000000 1.0000000 4.891365e-11 0.000000e+00 46
5: Zhang 1.0000000 1.0000000 1.0000000 5.529073e-06 8.043461e-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-patched-linux-x86_64
Version: 0.3.10
Check: examples
Result: ERROR
Running examples in ‘phenofit-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### 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
Examples with CPU (user + system) or elapsed time > 5s
user system elapsed
curvefits 4.826 0.071 5.719
plot_curvefits 4.534 0.059 5.976
Flavor: r-release-linux-x86_64
Version: 0.3.10
Check: tests
Result: ERROR
Running ‘testthat.R’ [74s/93s]
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 1677. 0.202 0.576 0.00832 2.84 0.00990 3.48
Saving _problems/test-PhenoExtract-63.R
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 1.389780e-09 0.000000e+00 46
3: Elmore 1.0000000 1.0000000 1.0000000 4.161813e-10 0.000000e+00 46
4: Gu 1.0000000 1.0000000 1.0000000 4.891365e-11 0.000000e+00 46
5: Zhang 1.0000000 1.0000000 1.0000000 5.529073e-06 8.043461e-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-release-linux-x86_64
Version: 0.3.10
Check: tests
Result: ERROR
Running 'testthat.R' [96s]
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 1677. 0.202 0.576 0.00832 2.84 0.00990 3.48
Saving _problems/test-PhenoExtract-63.R
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 1.389780e-09 0.000000e+00 46
3: Elmore 1.0000000 1.0000000 1.0000000 4.161813e-10 0.000000e+00 46
4: Gu 1.0000000 1.0000000 1.0000000 1.536880e-11 0.000000e+00 46
5: Zhang 1.0000000 1.0000000 1.0000000 5.529073e-06 8.043461e-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-release-windows-x86_64
Version: 0.3.10
Check: tests
Result: ERROR
Running 'testthat.R' [98s]
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 1677. 0.202 0.576 0.00832 2.84 0.00990 3.48
Saving _problems/test-PhenoExtract-63.R
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 1.389780e-09 0.000000e+00 46
3: Elmore 1.0000000 1.0000000 1.0000000 4.161813e-10 0.000000e+00 46
4: Gu 1.0000000 1.0000000 1.0000000 1.536880e-11 0.000000e+00 46
5: Zhang 1.0000000 1.0000000 1.0000000 5.529073e-06 8.043461e-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-oldrel-windows-x86_64
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.