View source: R/hypervolume_threshold.R
hypervolume_threshold | R Documentation |
Thresholds a hypervolume at a given value that can correspond to a quantile of the hypervolume. All random points below the threshold value are removed and the volume is adjusted accordingly. Provides threshold-quantile plots if multiple thresholds are specified (as by default).
Quantiles can be specified to be either of the total volume enclosed by the hypervolume p(proportional to nrow(hv@RandomPoints)
), or of the total probability density (proportional to sum(hv@ValueAtRandomPoints)
).
hypervolume_threshold(hv,
thresholds = NULL,
num.thresholds = 20,
quantile.requested = NULL,
quantile.requested.type = "volume",
uniform.density = TRUE,
plot = TRUE, verbose = TRUE)
hv |
An input hypervolume |
thresholds |
A sequence of probability threshold values. If |
num.thresholds |
The number of threshold values to use if |
quantile.requested |
If not |
quantile.requested.type |
Determines the quantile type: either |
uniform.density |
Logical value. If |
plot |
Plots a threshold-quantile plot if |
verbose |
If |
Hypervolumes constructed using the hypervolume_box
method may not always yield quantiles close to the requested value because of the flat shape of the kernel.
A list containing two elements: a HypervolumeList
or Hypervolume
object corresponding to the hypervolumes at each threshold value, and a dataframe Statistics
corresponding to the relevant quantiles and thresholds.
## Not run:
data(penguins,package='palmerpenguins')
penguins_no_na = as.data.frame(na.omit(penguins))
penguins_adelie = penguins_no_na[penguins_no_na$species=="Adelie",
c("bill_length_mm","bill_depth_mm","flipper_length_mm")]
hv = hypervolume_box(penguins_adelie,name='Adelie')
# get hypervolumes at multiple thresholds
hvlist = hypervolume_threshold(hv, plot=TRUE)
head(hvlist$Statistics)
plot(hvlist$HypervolumesThresholded[[c(1,5,10,15,20)]],
show.random=TRUE, show.data=FALSE,show.centroid=FALSE)
# get hypervolume for a single low quantile value
plot(hypervolume_threshold(hv, plot=FALSE, verbose=FALSE,
quantile.requested=0.1,quantile.requested.type="volume")[[1]])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.