ecocbo is an R package that helps scientists calculate the optimum sampling effort for community ecology projects. The package is based on the principles developed in the SSP package, which simulates ecological communities by extracting and using parameters that control the simulation. The simulated communities are then compared with PERMANOVA to estimate their components of variation and consequently the optimal sampling effort.
ecocbo is a valuable tool for scientists who need to design efficient sampling plans. The package can help scientists to save time and money by ensuring that they collect the minimum amount of data necessary to achieve their research goals.
You can easilly obtain ‘ecocbo’ from CRAN:
install.packages("ecocbo")
Alternatively, you can install the development version of ecocbo from GitHub:
# install.packages("devtools")
::install_github("arturoSP/ecocbo") devtools
This is a basic example which shows you how to use the different functions in the package:
# Load data and adjust it.
data(epiDat)
<- epiDat
epiH0 "site"] <- as.factor("T0")
epiH0[,<- epiDat
epiHa "site"] <- as.factor(epiHa[,"site"])
epiHa[,
# Calculate simulation parameters.
<- SSP::assempar(data = epiH0, type = "counts", Sest.method = "average")
parH0 <- SSP::assempar(data = epiHa, type = "counts", Sest.method = "average")
parHa
# Simulation.
<- SSP::simdata(parH0, cases = 3, N = 1000, sites = 1)
simH0Dat <- SSP::simdata(parHa, cases = 3, N = 100, sites = 10) simHaDat
<- sim_beta(simH0Dat, simHaDat,
betaResult n = 5, m = 4, k = 30,
alpha = 0.05,
transformation = "square root", method = "bray",
dummy = FALSE,
useParallel = TRUE)
betaResult#> Power at different sampling efforts (m x n):
#> n = 2 n = 3 n = 4 n = 5
#> m = 2 0.50 0.75 0.84 0.97
#> m = 3 0.44 0.96 0.97 1.00
#> m = 4 0.80 1.00 1.00 1.00
plot_power(data = betaResult, n = NULL, m = 3, method = "power")
<- scompvar(data = betaResult)
compVar
compVar#> compVarA compVarR
#> 1 0.09943608 0.2626768
The sampling effort can be evaluated depending on an economic budget (ct) or desired precision level (multSE), depending on the proposed parameter, the function will calculate optimal values for number of treatments (bOpt) and replicates (nOpt).
<- sim_cbo(comp.var = compVar, ct = 20000, ck = 100, cj = 2500)
cboCost
cboCost#> nOpt mOpt
#> 1 8 6
<- sim_cbo(comp.var = compVar, multSE = 0.10, ck = 100, cj = 2500)
cboPrecision
cboPrecision#> nOpt mOpt
#> 1 8 13