voloverlap(tcsres1, tcsres2, plot = FALSE,
col = c("blue", "red", "darkgrey"), new = TRUE,
montecarlo = FALSE, nsamp = 1000, psize = 0.001)tcs function, containing values
for the 'x', 'y' and 'z' coordinates as columns (labeled
as such)FALSE)FALSE, volumes and their overlap are plotted
over the current plot (defaults to TRUE).TRUE, Monte Carlo
simulation is used instead of exact solution (not
recommended; defaults to FALSE)montecarlo=TRUE, determines the
number of points to be sampled.montecarlo=TRUE and
plot=TRUE, sets the size to plot the points used
in the Monte Carlo simulation.vsmallestthe volume of the overlap divided by the
smallest of that defined by the the two input sets of
color points. Thus, if one of the volumes is entirely
contained within the other, this overlap will bevsmallest = 1.vboththe volume of
the overlap divided by the combined volume of both input
sets of color points.The Monte Carlo solution is available mostly for legacy and benchmarking, and is not recommended (see notes). If used, the output will be different:
s_in1, s_in2the number of sampled points that
fall within each of the volumes individuallys_inboththe number of sampled points that fall
within both volumess_ineitherthe number of
points that fall within either of the volumespsmallestthe proportion of points that fall
within both volumes divided by the number of points that
fall within the smallest volumepboththe
proportion of points that fall within both volumes
divided by the total number of points that fall within
both volumesIf the Monte Carlo solution is used, a number of points much greater than the default should be considered (Stoddard & Stevens(2011) use around 750,000 points, but more or fewer might be required depending on the degree of overlap.)
Stoddard, M. C., & Stevens, M. (2011). Avian vision and the evolution of egg color mimicry in the common cuckoo. Evolution, 65(7), 2004-2013.
Villeger, S., Novack-Gottshall, P. M., & Mouillot, D. (2011). The multidimensionality of the niche reveals functional diversity changes in benthic marine biotas across geological time. Ecology Letters, 14(6), 561-568.
data(sicalis)
tcs.sicalis.C <- subset(tcs(vismodel(sicalis)), 'C')
tcs.sicalis.T <- subset(tcs(vismodel(sicalis)), 'T')
tcs.sicalis.B <- subset(tcs(vismodel(sicalis)), 'B')
voloverlap(tcs.sicalis.T,tcs.sicalis.B)
voloverlap(tcs.sicalis.T,tcs.sicalis.C, plot=T)
voloverlap(tcs.sicalis.T,tcs.sicalis.C, plot=T, col=1:3)Run the code above in your browser using DataLab