View source: R/hypervolume_to_data_frame.R
hypervolume_to_data_frame | R Documentation |
data.frame
Convert objects of class Hypervolume
or HypervolumeList
to a data.frame
.
hypervolume_to_data_frame(hv, remove_zeroes = TRUE)
hv |
A |
remove_zeroes |
Remove zeroes from |
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.
A data.frame
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.