The `comspat_plot()` function makes use of core R graphics systems to display relationship between the Information Theory metrics (i.e. CD, NRC, etc.) and the length (default) or area of the sampling units. The `comspat_plot()` does not calculate the Information Theory metrics, but it accepts results from the [`comspat()`] function.
Usage
comspat_plot(
data = NULL,
params = NULL,
type = NULL,
measure = NULL,
su_size = NULL,
unit = "Length",
ymin = NULL,
ymax = NULL,
xmin = 0.01,
xmax = 100,
p_col = "black",
p_cex = 0.75,
cex_axis = 1,
xaxt = TRUE,
yaxt = TRUE,
stats_output = FALSE,
ci_type = NULL
)
Arguments
- data
list of data frames or statistical output returned from
comspat
.- params
Data frame providing the secondary sampling information.
- type
Character. Supply either `"Grid"` or `"Transect"`.
- measure
Character. Supply one of `"CD"`, `"NRC"`, `"AS"`.
- su_size
Numeric. Surface area of the smallest sampling unit (mm sq.).
- unit
Character. Supply either `"Length"` or `"Area"`.
- ymin
Numeric. Y axis lower limit.
- ymax
Numeric. Y axis upper limit.
- xmin
Numeric. Minimum x axis value (i.e. lower range).
- xmax
Numeric. Maximum x axis value (i.e. upper range).
- p_col
list of colors. Single or a vector matching data length.
- p_cex
Numeric.
- cex_axis
Numeric.
- xaxt
TRUE or FALSE. Controls if x-axis text is displayed.
- yaxt
TRUE or FALSE. Controls if y-axis text is displayed.
- stats_output
`TRUE` or `FALSE`. Controls if confidence intervals display.
- ci_type
`"l"` or `"py"`. Confidence interval as line or polygon.
Value
The function does not return a value, rather it returns a plot object to assist users in interpreting the results.
Details
`comspat_plot()` constructs the initial plot object. It has the functionality to return single or multiple outputs. When multiple outputs are returned the data must be supplied as a list; a single measure for each of the data frames will be added to the same plot. Confidence intervals generated from the use of null models (i.e. CSR and RS randomizations) can be added as lines or polygons (see the `"ci_type"` argument).
This function and makes use of core R graphics systems to explore the outputs of `comspat_plot()`.
Examples
# Load the training data and parameter files
data("grid_random", library = "comspat")
#> Warning: data set ‘comspat’ not found
data("param_grid", library = "comspat")
#> Warning: data set ‘comspat’ not found
# Perform comspat calculations
temp_rand <- comspat(
grid_random,
param_grid[1:2, ],
64,
"Grid"
)
# Plot comspat results
comspat_plot(
list(temp_rand),
param_grid[1:2, ],
"Grid",
measure = "NRC",
su_size = 0.01,
ymin = 0,
ymax = 65,
p_col = list("red")
)
# Hint - several measures can be combined using par() commands