if (FALSE) {
data(beesCountrySubset)
# Transform data for iNEXT
data_nextWrapper <- beesCountrySubset %>%
dplyr::group_by(scientificName, country_suggested) %>%
dplyr::count()
# Calculate iNEXT with the wrapper function
output_iNEXTwrapper <- BeeBDC::iNEXTwrapper(data = data_nextWrapper,
variableColumn = "country_suggested",
valueColumn = "n",
mc.cores = 1)
# Transform data for iChao
data_iChao <- beesCountrySubset %>%
dplyr::group_by(scientificName, country_suggested) %>%
dplyr::count() %>%
dplyr::select(scientificName, country_suggested, n) %>%
tidyr::pivot_wider(names_from = country_suggested,
values_from = n,
values_fill = 0) %>%
## Create the rownames
tibble::column_to_rownames("scientificName") %>%
dplyr::tibble()
# Run the wrapper function
output_iChaowrapper <- BeeBDC::ChaoWrapper(data = data_iChao,
datatype = "abundance",
k = 10,
conf = 0.95,
mc.cores = 1)
# Make the plots!
plot_summary <- BeeBDC::ggRichnessWrapper(
iNEXT_in = output_iNEXTwrapper,
iChao_in = output_iChaowrapper,
nrow = 2,
ncol = 2,
labels = NULL,
fileName = "speciesRichnessPlots",
outPath = tempdir(),
base_width = 8.3,
base_height = 11.7,
dpi = 300)
}
Run the code above in your browser using DataLab