View source: R/hypervolume_prune.R
hypervolume_prune | R Documentation |
Identifies hypervolumes characterized either by a number of uniformly random points or a volume below a user-specified value and removes them from a HypervolumeList
.
This function is useful for removing small features that can occur stochastically during segmentation after set operations or hole detection.
hypervolume_prune(hvlist, num.points.min = NULL, volume.min = NULL, return.ids=FALSE)
hvlist |
A |
num.points.min |
The minimum number of points in each input hypervolume. |
volume.min |
The minimum volume in each input hypervolume |
return.ids |
If |
Either minnp
or minvol
(but not both) must be specified.
A HypervolumeList
pruned to only those hypervolumes of sizes above the desired value. If returnids=TRUE
, instead returns a list structure with first item being the HypervolumeList
and the second item being the indices of the retained hypervolumes.
hypervolume_holes
, hypervolume_segment
## 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_gaussian(penguins_adelie,name='Adelie')
hv_segmented <- hypervolume_segment(hv,
num.points.max=200, distance.factor=1,
check.memory=FALSE) # intentionally under-segment
hv_segmented_pruned <- hypervolume_prune(hv_segmented,
num.points.min=20)
plot(hv_segmented_pruned)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.