This function accumulates samples according their proximity to all previously included samples (their centroid) as opposed to the proximity to the initial focal sample. This ensures that included samples mutually close to each other and not all over the place.
kNCN_average(
x,
n = NULL,
coords = NULL,
repetitions = 1,
no_pb = TRUE,
latlong = FALSE,
cl = NULL
)
a numeric vector of estimated species richness
a mob_in object or a community site x species matrix
number of sites to include.
spatial coordinates of the samples. If x is a mob_in object, the function uses its 'spat' table as coordinates.
Number of times to repeat the procedure. Useful in situations where there are many ties in the distance matrix.
binary, if TRUE then a progress bar is not printed, defaults to TRUE
if longitude latitudes are supplied
A cluster object created by makeCluster
,
or an integer to indicate number of child-processes
(integer values are ignored on Windows) for parallel evaluations
(see Details on performance).
It can also be "future"
to use a future backend (see Details),
NULL
(default) refers to sequential evaluation.
Internally the function constructs one curve per sample whereby each sample serves as the initial sample repetition times. Finally, the average curve is returned.
data(inv_comm)
data(inv_plot_attr)
inv_mob_in = make_mob_in(inv_comm, inv_plot_attr, coord_names = c('x', 'y'))
kNCN_average(inv_mob_in, n = 5)
# \donttest{
# parallel evaluation using the parallel package
# run in parallel
library(parallel)
cl = makeCluster(2L)
clusterEvalQ(cl, library(mobr))
clusterExport(cl, 'inv_mob_in')
S_kNCN = kNCN_average(inv_mob_in, cl=cl)
stopCluster(cl)
# }
Run the code above in your browser using DataLab