tests/testthat/test-mantel.R

context("mantel")

test_that("mantel r is the correlation", {
          set.seed(888)
          x <- runif(110)
          y <- runif(110)
          x <- dist(x)
          y <- dist(y)
          expect_equal(as.vector(mantel(y ~ x, nperm=0, nboot=0))[1], cor(x, y))
})

Try the ecodist package in your browser

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

ecodist documentation built on Nov. 2, 2023, 6:01 p.m.