Running ‘testthat.R’ [53s/71s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat) 
  > library(codyn)
  > test_check("codyn")
  ── 1. Error: RAC_change function returns correct result (@test_RAC_change.R#85) 
  replacement has 1 row, data has 0
  1: expect_warning(RAC_change(bdat4, abundance.var = "relative_cover", replicate.var = "plot", 
         species.var = "species", time.var = "year"), "evenness_change values contain NAs because there are plots with only one species") at testthat/test_RAC_change.R:85
  2: quasi_capture(enquo(object), capture_warnings, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: RAC_change(bdat4, abundance.var = "relative_cover", replicate.var = "plot", species.var = "species", 
         time.var = "year")
  7: split_apply_combine(allsp, by, FUN = add_ranks, abundance.var)
  8: lapply(dfs, FUN = FUN, ...)
  9: FUN(X[[i]], ...)
  10: `[<-`(`*tmp*`, df[["rank"]] > S, "rank", value = 3)
  11: `[<-.data.frame`(`*tmp*`, df[["rank"]] > S, "rank", value = 3)
  12: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 2. Error: RAC_difference function returns correct result (@test_RAC_differenc
  replacement has 1 row, data has 0
  1: RAC_difference(dat3, replicate.var = "plot", abundance.var = "relative_cover", species.var = "species", 
         pool = TRUE, treatment.var = "treatment") at testthat/test_RAC_difference.R:121
  2: `[<-`(`*tmp*`, idx, abundance.var, value = 0)
  3: `[<-.data.frame`(`*tmp*`, idx, abundance.var, value = 0)
  4: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 3. Error: abundance_difference function returns correct result (@test_abundan
  replacement has 1 row, data has 0
  1: abundance_difference(dat3, replicate.var = "plot", abundance.var = "relative_cover", 
         species.var = "species", pool = TRUE, treatment.var = "treatment") at testthat/test_abundance_difference.R:110
  2: `[<-`(`*tmp*`, idx, abundance.var, value = 0)
  3: `[<-.data.frame`(`*tmp*`, idx, abundance.var, value = 0)
  4: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 4. Error: curve_change function returns correct result (@test_curve_change.R#
  replacement has 1 row, data has 0
  1: curve_change(dat1, time.var = "year", abundance.var = "relative_cover", species.var = "species") at testthat/test_curve_change.R:27
  2: split_apply_combine(df, by, FUN = add_rank_abundance, species.var, abundance.var)
  3: lapply(dfs, FUN = FUN, ...)
  4: FUN(X[[i]], ...)
  5: add_ranks(df, abundance.var)
  6: `[<-`(`*tmp*`, df[["rank"]] > S, "rank", value = 19)
  7: `[<-.data.frame`(`*tmp*`, df[["rank"]] > S, "rank", value = 19)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 5. Error: curve_difference function returns correct result (@test_curve_diffe
  replacement has 1 row, data has 0
  1: curve_difference(dat1, replicate.var = "plot", abundance.var = "relative_cover", 
         species.var = "species") at testthat/test_curve_difference.R:33
  2: split_apply_combine(df, by, FUN = add_rank_abundance, species.var, abundance.var)
  3: lapply(dfs, FUN = FUN, ...)
  4: FUN(X[[i]], ...)
  5: add_ranks(df, abundance.var)
  6: `[<-`(`*tmp*`, df[["rank"]] > S, "rank", value = 24)
  7: `[<-.data.frame`(`*tmp*`, df[["rank"]] > S, "rank", value = 24)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 292 SKIPPED: 0 FAILED: 5
  1. Error: RAC_change function returns correct result (@test_RAC_change.R#85) 
  2. Error: RAC_difference function returns correct result (@test_RAC_difference.R#121) 
  3. Error: abundance_difference function returns correct result (@test_abundance_difference.R#110) 
  4. Error: curve_change function returns correct result (@test_curve_change.R#27) 
  5. Error: curve_difference function returns correct result (@test_curve_difference.R#33) 
  
  Error: testthat unit tests failed
  Execution halted