aboutsummaryrefslogblamecommitdiff
path: root/tests/testthat/test_f_time_norm.R
blob: d5b899029208d962da055a11b39eaa12cd7ca40a (plain) (tree)
1
2
3
4
5
6
7
8
9




                                                                  
                                                          
                                                                                            
                                                                                    
                                                      
                                                        
                                                       
        
                                              

                                              
  
context("Time step normalisation")

test_that("Simple temperature and moisture normalisation works", {
  expect_equal(round(f_time_norm_focus(25, 20, 25), 2), 1.37)
})

test_that("Time step normalisation for a dataset works", {
  expect_message(f_time_norm_focus(D24_2014, study_moisture_ref_source = "focus", f_na = 1))
  expect_equal(round(D24_2014$f_time_norm, 3), c(1.606, 0.712, 0.716, 0.716, 0.898))
  expect_message(f_time_norm_focus(dimethenamid_2018))

  # Reference values from Dimethenamid RAR 2018 Vol3 B.8
  expect_equal(round(dimethenamid_2018$f_time_norm, 3),
    c(1,
      0.971,                           # p. 56
      rep(round(1.329 * 0.924, 3), 2), # p. 51
      0.623, 0.768, 0.673)             # p. 45
  )
})

Contact - Imprint