tests/testthat/test-season_input.R

test_that("movmean works", {
    # set global options 
    set_options(
        wFUN = wTSM, wmin = 0.2,
        verbose = FALSE,
        season = list(
            # rFUN = "smooth_wWHIT", lambda = 0.5,
            rFUN = "smooth_wHANTS", nf = 6,
            maxExtendMonth = 12, r_min = 0.05
        )
    )
    brk = season_input(input_single)
    # plot_season(input_single, brk)
    expect_equal(nrow(brk$dt), 2)

    brk = season_input(input_single, options = list(r_min = 0.02))
    expect_equal(nrow(brk$dt), 2)

    brk = season_input(input_single, options = list(r_min = 0.0))
    expect_equal(nrow(brk$dt), 2)
})

Try the phenofit package in your browser

Any scripts or data that you put into this service are public.

phenofit documentation built on Feb. 16, 2023, 6:21 p.m.