Skip to contents

Context

The goal of ecooc is to implement common ecological methods that deal with presence absence matrices. Performance was one of the most important feature the core of the function are therefore written in C++.

Generating presence-absence

mat <- ec_generate_pa(20, 10, .4)
#>  ! Empty site(s): 7, 16

Rarefaction

mat <- matrix(stats::runif(2000) > .9, ncol = 20)
res <- apply(ec_rarefaction(mat, 1000), 1, mean)
#>  ! Empty site(s): 1, 15, 27, 38, 46, 49, 50, 53, 55, 58, 60, 63, 69, 83, 93, 96
plot(res, type = "l", lwd = 2)