plot_ssp: SSP Plot: Visualization of MultSE and Sampling Effort

View source: R/plot_ssp.R

plot_sspR Documentation

SSP Plot: Visualization of MultSE and Sampling Effort

Description

Plots the relationship between MultSE and sampling effort using results from SSP simulations.

Usage

plot_ssp(xx, opt, multi.site)

Arguments

xx

A data frame generated by summary_ssp.

opt

A vector or data matrix generated by ioptimum.

multi.site

Logical. Indicates whether several sites were simulated.

Details

This function visualizes the behavior of MultSE (pseudo-multivariate standard error) as sampling effort increases. If simulations involve two sampling scales (e.g., sites and samples), separate graphs are generated. Two shaded bands highlight sub-optimal (light grey) and optimal (dark grey) improvements in precision. The graph also displays the relative gain in precision (as cumulative percentage) for each level of sampling effort, compared to the lowest.

This visualization helps identify when additional sampling effort results in diminishing returns. The plot is generated using ggplot2 and can be further customized.

Value

A ggplot2 object.

Note

This is an exploratory plot and can be edited or extended using standard ggplot2 functions.

References

Guerra-Castro, E.J., Cajas, J.C., Simões, N., Cruz-Motta, J.J., & Mascaró, M. (2021). SSP: an R package to estimate sampling effort in studies of ecological communities. Ecography 44(4), 561-573. doi: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/ecog.05284")}

Wickham, H. (2016). ggplot2: Elegant Graphics for Data Analysis. Springer.

See Also

ggplot2

Examples

## Single site: micromollusk from Cayo Nuevo (Yucatan, Mexico)
data(micromollusk)
par.mic <- assempar(data = micromollusk, type = "P/A", Sest.method = "average")
sim.mic <- simdata(par.mic, cases = 3, N = 20, sites = 1)
sam.mic <- sampsd(dat.sim = sim.mic, Par = par.mic, transformation = "P/A",
                  method = "jaccard", n = 10, m = 1, k = 3)
summ.mic <- summary_ssp(results = sam.mic, multi.site = FALSE)
opt.mic <- ioptimum(xx = summ.mic, multi.site = FALSE)
plot_ssp(xx = summ.mic, opt = opt.mic, multi.site = FALSE)

## Multiple sites: Sponges from Alacranes National Park (Yucatan, Mexico)
data(sponges)
par.spo <- assempar(data = sponges, type = "counts", Sest.method = "average")
sim.spo <- simdata(par.spo, cases = 3, N = 10, sites = 3)
sam.spo <- sampsd(dat.sim = sim.spo, Par = par.spo, transformation = "square root",
                  method = "bray", n = 10, m = 3, k = 3)
summ.spo <- summary_ssp(results = sam.spo, multi.site = TRUE)
opt.spo <- ioptimum(xx = summ.spo, multi.site = TRUE)
plot_ssp(xx = summ.spo, opt = opt.spo, multi.site = TRUE)


SSP documentation built on June 8, 2025, 11:41 a.m.