View source: R/ct_plot_inext.R
| ct_plot_inext | R Documentation |
plot sample-size-based and coverage-based rarefaction/extrapolation curves along with a bridging sample completeness curve
ct_plot_inext(
inext_object,
type = 1,
se = TRUE,
facet_var = "None",
color_var = "Assemblage",
grey = FALSE
)
inext_object |
an object as outputed by |
type |
three types of plots:
|
se |
a logical variable to display confidence interval around the estimated sampling curve. |
facet_var |
create a separate plot for each value of a specified variable:
|
color_var |
create curves in different colors for values of a specified variable:
|
grey |
a logical variable to display grey and white ggplot2 theme |
a ggplot2 object
if (requireNamespace("iNEXT", quietly = TRUE)) {
## Import example data
data(penessoulou)
camdata1 <- penessoulou %>%
dplyr::filter(project == "Last") %>%
dplyr::mutate(site = "pene") %>%
# remove consecutive entry of the same species at the same location within 60s
ct_independence(species_column = species,
site_column = camera,
datetime = datetimes,
threshold = 60, format = "%Y-%m-%d %H:%M:%S"
)
head(camdata1)
# Prepare sampling data (camera-day)
camday <- ct_camera_day(
data = camdata1,
deployment_column = camera,
datetime_column = datetime,
species_column = species,
size_column = number
)
# RAREFACTION/EXTRAPOLATION
int_ext <- ct_inext(data = camday,
diversity_order = c(0, 1, 2),
species_column = species,
site_column = sampling_unit,
size_column = number,
n_bootstrap = 50)
int_ext
# plot with curves colored by order
ct_plot_inext(int_ext, type = 1, color_var = "Order.q")
# plot with curves faceted by order
ct_plot_inext(int_ext, type = 1, facet_var = "Order.q")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.