tests/testthat/test-get_clado_rate.R

context("get_clado_rate")

test_that("classic behaviour", {
  ps_clado_rate <- 0.2
  carr_cap <- 9
  n_species <- 4
  
  created <- get_clado_rate(
    timeval = 5,
    lac = ps_clado_rate,
    Tpars = NULL,
    Apars = NULL,
    island_ontogeny = 0,
    island_spec = matrix(NA, nrow = n_species, ncol = 1),
    K = carr_cap
  )
    
  expected <- DAISIE_calc_clade_clado_rate(
    ps_clado_rate = ps_clado_rate,
    n_species = n_species,
    
    carr_cap = carr_cap
  )
  expect_equal(created, expected)
})
xieshu95/Trait_dependent_TraiSIE documentation built on Nov. 22, 2019, 7:51 a.m.