
ecocbo is an R package that helps scientistscalculate the optimum sampling effort for community ecology projects.The package is based on the principles developed in theSSP package, whichsimulates ecological communities by extracting and using parameters thatcontrol the simulation. The simulated communities are then compared withPERMANOVA to estimate their components of variation and consequently theoptimal sampling effort.
ecocbo is a valuable tool for scientists who need todesign efficient sampling plans. The package can help scientists to savetime and money by ensuring that they collect the minimum amount of datanecessary to achieve their research goals.
You can easily obtain ‘ecocbo’ from CRAN:
install.packages("ecocbo")Alternatively, you can install the development version of ecocbo fromGitHub:
install.packages("devtools")devtools::install_github("arturoSP/ecocbo")This is a basic example which shows you how to use the differentfunctions in the package:
# Load data and pre-process it.data(epiDat)simResults<-prep_data(data = epiDat,type ="counts",Sest.method ="average",cases =5,N =100,M =10,n =5,m =5,k =30,transformation ="none",method ="bray",dummy =FALSE,useParallel =FALSE,model ="single.factor")compVar<-scompvar(data = simResults)compVar#> Source Est.var.comp#> 1 Residual 0.331926betaResult<-sim_beta(simResults,alpha =0.05)betaResult#> Power at different sampling efforts (n):#> Power#> n = 2 0.44#> n = 3 0.70#> n = 4 0.93#> n = 5 0.97The sampling effort can be evaluated depending on an economic budget(ct) or desired precision level (multSE), depending on the proposedparameter, the function will calculate optimal values for number oftreatments (bOpt) and replicates (nOpt).
cboCost<-sim_cbo(betaResult,cn =75)cboCost#> Sampling designs that meet the required power:#> n Power Cost Suggested#> 2 0.4366667 150#> 3 0.7033333 225#> 4 0.9266667 300#> 5 0.9716194 375 ***#>#> The listed cost is per treatment.# This plot will look different in every simulationplot_power(data = betaResult,n =NULL,method ="power")
Required: SSP, ggplot2, ggpubr, sampling, stats, rlang, foreach,parallel, doParallel, doSNOW, vegan, plotly
Suggested: knitr, rmarkdown, testthat

