tests/testthat/test_PhenoFlex.R

context('PhenoFlex')

test_that('PhenoFlex_1', {
  data(KA_weather)
  hourtemps <- chillR::stack_hourly_temps(KA_weather, latitude=50.4)
  iSeason <- chillR::genSeason(hourtemps, years=c(2009))
  zc <- 190
  yc <- 40
  x <- chillR::PhenoFlex(temp=hourtemps$hourtemps$Temp[iSeason[[1]]],
                         times=c(1: length(hourtemps$hourtemps$Temp[iSeason[[1]]])),
                         zc=zc, stopatzc=TRUE, yc=yc, basic_output=FALSE)
  DBreakDay <- x$bloomindex
  expect_equal(DBreakDay, 6170, tolerance=1)
})

Try the chillR package in your browser

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

chillR documentation built on Nov. 28, 2023, 1:09 a.m.