View source: R/richnessPrepR.R
| richnessPrepR | R Documentation |
Takes your occurrence dataset along with a taxonomy and checklist in order to produce
a file that's ready to be passed into the richnessEstimateR() function in order to
estimate species richness using
iChao and iNEXT (hill numbers) for countries, continents, or the entire globe.
richnessPrepR(
data = NULL,
taxonomyFile = BeeBDC::beesTaxonomy(),
checklistFile = BeeBDC::beesChecklist(),
curveFunction = function(x) (228.7531 * x * x^-log(12.1593)),
sampleSize = 10000,
countryColumn = "country_suggested",
limitGlobal = NULL,
outPath = tempdir()
)
data |
A data frame or tibble. Occurrence records as input. Needs to include the
|
taxonomyFile |
A data frame or tibble. The taxonomy file to use.
Default = |
checklistFile |
A data frame or tibble. The taxonomy to use.
Default = |
curveFunction |
A function. The mathematical function that describes the curve used to
randomly sample from in order to fill empty sample sizes for species present in the checklist
but not present in the occurrence dataset. Default is |
sampleSize |
Numeric. The size of the sample randomly drawn from the provided curve.
See |
countryColumn |
Character. The column from which country names should be sought. |
limitGlobal |
Character vector. A character vector of the countries to filter the data to in order limit the extent of the global-level analysis. Defualt = NULL. |
outPath |
Character. The output path where the curve plot (curvePlot.pdf) and the output
Rdata (richnessInputs.Rda) file will be saved. Default = |
Saves an Rdata file with the data needed to feed into the richnessEstimateR()
function. The richnessEstimateR() function will then
use iChao and/or iNEXT to estimate species richness for countries, continents, and the globe.
Also returns the RData file to the environment.
countryHarmoniseR() to harmonise country names based on a short list.
## Not run:
data(beesCountrySubset)
estimateDataExample <- richnessPrepR(
data = beesCountrySubset,
# Download the taxonomy
taxonomyFile = BeeBDC::beesTaxonomy(),
# Download the checklist
checklistFile = BeeBDC::beesChecklist(),
curveFunction = function(x) (228.7531 * x * x^-log(12.1593)),
sampleSize = 10000,
countryColumn = "country_suggested",
limitGlobal = NULL,
outPath = tempdir()
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.