tests/testthat/testcorral.R

context("corral")

library(corral)
library(ade4)

test_that('same eigens as dudi.coa',{
  mat <- matrix(sample(0:10, 500, replace=TRUE), ncol=25)
  a <- corral(mat,ncomp = 2)
  b <- dudi.coa(mat, scannf = FALSE, nf = 2)
  expect_equal(all.equal(b$eig[1:2],a$d[1:2]^2),TRUE)
})


# add checks that it takes sce / mat

# add checks for thin and thick matrix

Try the corral package in your browser

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

corral documentation built on Nov. 8, 2020, 8:25 p.m.