plot_ssp {SSP} | R Documentation |
SSP plot
Description
Plotting MultSE and sampling effort relationships of simulated data
Usage
plot_ssp(xx, opt, multi.site)
Arguments
xx |
A data frame generated by |
opt |
A vector or data matrix generated by |
multi.site |
Logical argument indicating whether several sites were simulated |
Details
This function allows to visualize the behavior of the MultSE as sampling effort increases. When the simulation involves two sampling scales, a graph for samples and one for sites will be generated. Above the MultSE~Sampling effort projection, two shaded areas are drawn, highlighting: sub-optimal improvement (light grey), and optimal improvement (dark gray). Both reflect the sampling effort that improves the precision at acceptable (light gray) or desirable levels (dark gray), but beyond the later, any gain could be considered unnecessary. In addition, for each sampling effort, the relativized improvement (in relation to the MultSE estimated with the lower sampling effort) is presented cumulatively (as percentages). This is very useful because it indicates exactly how much the precision is improved for each sampling effort.The plot is generated using ggplot2
.
Value
A ggplot2
object
Note
This is an exploratory plot that can be edited using ggplot2
functions.
Author(s)
Edlin Guerra-Castro (edlinguerra@gmail.com), Juan Carlos Cajas, Juan Jose Cruz-Motta, Nuno Simoes and Maite Mascaro (mmm@ciencias.unam.mx)
References
Guerra-Castro, E. J., J. C. Cajas, F. N. Dias Marques Simoes, J. J. Cruz-Motta, and M. Mascaro. (2020). SSP: An R package to estimate sampling effort in studies of ecological communities. bioRxiv:2020.2003.2019.996991.
Wickham, H. 2016. ggplot2: elegant graphics for data analysis. Springer.
See Also
Examples
###To speed up the simulation of these examples, the cases, sites and N were set small.
##Single site: micromollusk from Cayo Nuevo (Yucatan, Mexico)
data(micromollusk)
#Estimation of parameters of pilot data
par.mic<-assempar (data = micromollusk,
type= "P/A",
Sest.method = "average")
#Simulation of 3 data sets, each one with 20 potential sampling units from a single site
sim.mic<-simdata(par.mic, cases= 3, N = 20, sites = 1)
#Sampling and estimation of MultSE for each sample size (few repetitions
#to speed up the example)
sam.mic<-sampsd(dat.sim = sim.mic,
Par = par.mic,
transformation = "P/A",
method = "jaccard",
n = 10,
m = 1,
k = 3)
#Summary of MultSE for each sampling effort
summ.mic<-summary_ssp(results = sam.mic, multi.site = FALSE)
#Cut-off points to identify optimal sampling effort
opt.mic<-ioptimum(xx = summ.mic, multi.site = FALSE)
#Plot
plot_ssp(xx = summ.mic, opt = opt.mic, multi.site = FALSE)
##Multiple sites: Sponges from Alacranes National Park (Yucatan, Mexico).
data(sponges)
#Estimation of parameters of pilot data
par.spo<-assempar(data = sponges,
type= "counts",
Sest.method = "average")
#Simulation of 3 data sets, each one with 10 potential sampling units in 3 sites.
sim.spo<-simdata(par.spo, cases= 3, N = 10, sites = 3)
#Sampling and estimation of MultSE for each sampling design (few repetitions
#to speed up the example)
sam.spo<-sampsd(dat.sim = sim.spo,
Par = par.spo,
transformation = "square root",
method = "bray",
n = 10,
m = 3,
k = 3)
#Summary of MultSE for each sampling effort
summ.spo<-summary_ssp(results = sam.spo, multi.site = TRUE)
#Cut-off points to identify optimal sampling effort
opt.spo<-ioptimum(xx = summ.spo, multi.site = TRUE)
#Plot
plot_ssp(xx = summ.spo, opt = opt.spo, multi.site = TRUE)