tests/testthat/test-sperrorest-misc.R

context("sperrorest-misc.R")

# dataset_distance Sat Jun  3 14:41:05 2017 ------------------------------------

test_that("dataset_distance works correctly", {
  df <- data.frame(x = rnorm(100), y = rnorm(100))
  out <- dataset_distance(df, df) # == 0
  expect_equal(out, 0)
})

# add.distance Sat Jun  3 14:45:34 2017 ----------------------------------------

test_that("add.distance works correctly", {
  data(ecuador) # Muenchow et al. (2012), see ?ecuador
  nsp_parti <- partition_cv(ecuador)
  nsp_parti <- add.distance(nsp_parti, data = ecuador)

  expect_length(nsp_parti[[1]], 10)
})

Try the sperrorest package in your browser

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

sperrorest documentation built on Oct. 16, 2022, 5:05 p.m.