- using R Under development (unstable) (2025-11-05 r88988)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
Debian clang version 19.1.7 (7)
Debian flang-new version 19.1.7 (7)
- running under: Debian GNU/Linux forky/sid
- using session charset: UTF-8
- checking for file ‘phenofit/DESCRIPTION’ ... OK
- checking extension type ... Package
- this is package ‘phenofit’ version ‘0.3.10’
- package encoding: UTF-8
- checking CRAN incoming feasibility ... [2s/2s] OK
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking serialization versions ... OK
- checking whether package ‘phenofit’ can be installed ... OK
See the install log for details.
- used C compiler: ‘Debian clang version 19.1.7 (7)’
- used C++ compiler: ‘Debian clang version 19.1.7 (7)’
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking ‘build’ directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [3s/4s] OK
- checking whether the package can be loaded with stated dependencies ... [2s/3s] OK
- checking whether the package can be unloaded cleanly ... [2s/3s] OK
- checking whether the namespace can be loaded with stated dependencies ... [2s/3s] OK
- checking whether the namespace can be unloaded cleanly ... [2s/4s] OK
- checking loading without being on the library search path ... [3s/4s] OK
- checking whether startup messages can be suppressed ... [2s/4s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [28s/38s] OK
- checking Rd files ... [1s/1s] OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of ‘data’ directory ... OK
- checking data for non-ASCII characters ... [0s/1s] OK
- checking LazyData ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking line endings in C/C++/Fortran sources/headers ... OK
- checking line endings in Makefiles ... OK
- checking compilation flags in Makevars ... OK
- checking for GNU extensions in Makefiles ... OK
- checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
- checking use of PKG_*FLAGS in Makefiles ... OK
- checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK
- checking pragmas in C/C++ headers and code ... OK
- checking compilation flags used ... OK
- checking compiled code ... OK
- checking installed files from ‘inst/doc’ ... OK
- checking files in ‘vignettes’ ... OK
- checking examples ... [20s/24s] 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
- checking for unstated dependencies in ‘tests’ ... OK
- checking tests ... [55s/64s] ERROR
Running ‘testthat.R’ [55s/63s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(phenofit)
>
> test_check("phenofit")
List of 5
$ AG : tibble [6 × 8] (S3: tbl_df/tbl/data.frame)
$ Beck : tibble [6 × 7] (S3: tbl_df/tbl/data.frame)
$ Elmore: tibble [6 × 8] (S3: tbl_df/tbl/data.frame)
$ Gu : tibble [6 × 10] (S3: tbl_df/tbl/data.frame)
$ Zhang : tibble [6 × 8] (S3: tbl_df/tbl/data.frame)
NULL
# A tibble: 6 × 8
flag t0 mn mx rsp a3 rau a5
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1999_1 -135. 0.201 0.636 0.00932 2.85 0.00852 2
2 2000_1 189. 0.238 0.635 0.0126 2.47 0.00801 3.21
3 2001_1 569. 0.252 0.626 0.0108 2.96 0.00950 2.96
4 2002_1 892. 0.253 0.614 0.0159 2 0.00724 3.08
5 2003_1 1268. 0.236 0.577 0.0121 2.88 0.00723 2.88
6 2004_1 1676. 0.202 0.576 0.00839 2.81 0.00980 3.52
meth R2 NSE R RMSE pvalue n_sim
<char> <num> <num> <num> <num> <num> <num>
1: AG 0.9986908 0.9985845 0.9993452 9.940385e-03 4.489925e-65 46
2: Beck 1.0000000 1.0000000 1.0000000 4.932917e-10 0.000000e+00 46
3: Elmore 1.0000000 1.0000000 1.0000000 3.945072e-10 0.000000e+00 46
4: Gu 1.0000000 1.0000000 1.0000000 8.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
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [34s/44s] OK
- checking PDF version of manual ... [10s/13s] OK
- checking HTML version of manual ... [4s/7s] OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 2 ERRORs