hypervolume_thin: Reduces the number of random points in a hypervolume

View source: R/hypervolume_thin.R

hypervolume_thinR Documentation

Reduces the number of random points in a hypervolume

Description

Many hypervolume algorithms have computational complexities that scale with the number of random points used to characterize a hypervolume (@RandomPoints). This value can be reduced to improve runtimes at the cost of lower resolution.

Usage

hypervolume_thin(hv, factor = NULL, num.points = NULL)

Arguments

hv

An object of class Hypervolume

factor

A number in (0,1) describing the fraction of random points to keep.

num.points

A number describing the number random points to keep.

Details

Either factor or npoints (but not both) must be specified.

Value

A Hypervolume object

Examples

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')

# downsample to 1000 random points
hv_thinned = hypervolume_thin(hv, num.points=1000)
hv_thinned

bblonder/hypervolume documentation built on Feb. 1, 2024, 8:01 p.m.