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 easily 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 pre-process it.
data(epiDat)
<- prep_data(data = epiDat,
simResults type = "counts", Sest.method = "average",
cases = 5, N = 100, sites = 10,
n = 5, m = 5, k = 30,
transformation = "none", method = "bray",
dummy = FALSE, useParallel = FALSE,
model = "single.factor")
<- scompvar(data = simResults)
compVar
compVar#> Source Est.var.comp
#> 1 A 0.07320045
#> 2 Residual 0.32940570
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
#> 1 200
<- sim_cbo(comp.var = compVar, multSE = 0.10, ck = 100, cj = 2500)
cboPrecision
cboPrecision#> nOpt
#> 1 32
<- sim_beta(simResults, alpha = 0.05)
betaResult
betaResult#> Power at different sampling efforts (m x n):
#> n = 2 n = 3 n = 4 n = 5
#> m = 2 0.25 0.41 0.76 0.89
#> m = 3 0.53 0.72 0.95 0.94
#> m = 4 0.39 0.85 0.95 0.99
#> m = 5 0.61 0.93 1.00 1.00
# This plot will look different in every simulation
plot_power(data = betaResult, n = NULL, m = 3, method = "power")
Required: SSP, ggplot2, ggpubr, sampling, stats, rlang, foreach, parallel, doParallel, doSNOW, vegan
Suggested: knitr, rmarkdown, testthat