creates comparative plots of two species accumulation curves
from information contained in lists obtained with the function
selected_sites_SAC.
Usage
compare_SAC(SAC_selected_sites, element_1, element_2, col_mean1 = "blue",
col_CI1 = "lightblue", col_mean2 = "gray15",
col_CI2 = "gray65", lty1 = 1, lty2 = 2,
alpha_mean = 0.9, alpha_CI = 0.3,
xlab = "Number of sites", ylab = "Species",
line_for_multiple = TRUE, add_legend = TRUE, ...)Arguments
- SAC_selected_sites
nested list of "
specaccum" objects obtained with functionselected_sites_SAC.- element_1
(numeric or character) index of position or character indicator of the first element (type of selection) in
SAC_selected_sitesto be plotted. Character options are: "random", "E", "G", "EG".- element_2
(numeric or character) index of position or character indicator of the second element (type of selection) in
SAC_selected_sitesto be plotted. Character options are: "random", "E", "G", "EG".- col_mean1
(character) color for mean value of curve in
element_1; default = "blue".- col_CI1
(character) color for confidence interval region for the curve in
element_1; default = "lightblue".- col_mean2
(character) color for mean value of curve in
element_2; default = "gray15".- col_CI2
(character) color for confidence interval region for the curve in
element_2; default = "gray65".- lty1
type of line for
element_1. See lty inpar.- lty2
type of line for
element_2. See lty inpar.- alpha_mean
(numeric) alpha level for line representing the mean, values from 0 to 1; default = 0.9. Values close to 0 increase transparency.
- alpha_CI
(numeric) alpha level for the region representing the confidence interval; default = 0.3.
- xlab
(character) label for x-axis of plot; default = "Number of sites".
- ylab
(character) label for y-axis of plot; default = "Species".
- line_for_multiple
(logical) whether to plot SACs only as lines when multiple objects are in one or more of the internal lists in
SAC_selected_sites. Default = TRUE.- add_legend
(logical) whether to add default legend to plot; default = TRUE.
- ...
other arguments to be passed to plot method for objects of class "
specaccum".
Value
A comparative plot of two species "specaccum" objects done based on
what is defined in element_1 and element_2.
Examples
# Data
b_pam <- read_PAM(system.file("extdata/b_pam.rds",
package = "biosurvey"))
m_selection <- read_master(system.file("extdata/m_selection.rds",
package = "biosurvey"))
# Subsetting base PAM according to selections
sub_pam_all <- subset_PAM(b_pam, m_selection, selection_type = "all")
SACs <- selected_sites_SAC(PAM_subset = sub_pam_all, selection_type = "all")
compare_SAC(SAC_selected_sites = SACs, element_1 = 1, element_2 = 2)