hypervolume_to_data_frame {hypervolume} | R Documentation |
Convert hypervolumes to data.frame
Description
Convert objects of class Hypervolume
or HypervolumeList
to a data.frame
.
Usage
hypervolume_to_data_frame(hv, remove_zeroes = TRUE)
Arguments
hv |
A |
remove_zeroes |
Remove zeroes from |
Details
Zero values are generated during the occupancy routine when a random point is included in some groups of hypervolumes but not in others. A tipical usage of hypervolume_to_data_frame()
with objects generated with the occupancy routine should remove zeroes.
Value
A data.frame
.
Examples
## Not run:
data(penguins,package='palmerpenguins')
penguins_no_na = as.data.frame(na.omit(penguins))
# split the dataset on species and sex
penguins_no_na_split = split(penguins_no_na,
paste(penguins_no_na$species, penguins_no_na$sex, sep = "_"))
# calculate the hypervolume for each element of the splitted dataset
hv_list = mapply(function(x, y)
hypervolume_gaussian(x[, c("bill_length_mm", "flipper_length_mm")],
samples.per.point=100, name = y),
x = penguins_no_na_split,
y = names(penguins_no_na_split))
hv_list <- hypervolume_join(hv_list)
# get the data.frame
hypervolume_to_data_frame(hv_list)
## End(Not run)
[Package hypervolume version 3.1.4 Index]