copy_param_hypervolume: Generate hypervolumes using pre-existing parameters

View source: R/copy_param_hypervolume.R

copy_param_hypervolumeR Documentation

Generate hypervolumes using pre-existing parameters

Description

copy_param_hypervolume takes in a hypervolume and data. After detecting the method used to generate the input hypervolume, the function returns a new hypervolume generated from the data using the same method and parameters as the input hypervolume.

Usage

copy_param_hypervolume(hv, data, name = NULL)

Arguments

hv

hypervolume object

data

A m x n matrix or data frame, where m is the number of observations and n is the dimensionality.

name

String name of hypervolume

Details

copy_param_hypervolume only works if the input hypervolume was generated using method = "box", method = "gaussian", or method = "svm". Calling this function on hypervolumes generated from hypervolume_set will result in an error. Note that kde.bandwidth is affected by size of the data and will be re-estimated using whichever method was used to generate the original bandwidth if method = "gaussian" or method = "box". Use hv@Parameters to see what parameters are copied from the input hypervolume.

Value

hypervolume object

Examples

## Not run: 
library(palmerpenguins)
data("penguins")
bill_data = na.omit(penguins[,3:4])
hv = hypervolume(data = bill_data, 
                  method = "gaussian", 
                  quantile.requested = .9, 
                  quantile.requested.type = "volume")

# Generates a new hypervolume using the same hypervolume and data
hv_copy = copy_param_hypervolume(hv, hv@Data)
# Check to see that the information of the two hypervolumes is the same
print(hv)
print(hv_copy)

## End(Not run)

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