Learn R Programming

hypervolume (version 3.1.4)

copy_param_hypervolume: 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)

Value

hypervolume object

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.

Examples

Run this code
if (FALSE) {
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)
}

Run the code above in your browser using DataLab