View source: R/hypervolume_n_resample.R
hypervolume_n_resample | R Documentation |
The function hypervolume_n_resample()
generates n hypervolumes using data bootstrapped from original data of the input hypervolumes.
hypervolume_n_resample(name,
hv_list,
n = 10,
points_per_resample = 'sample_size',
cores = 1,
verbose = TRUE,
seed = NULL)
name |
File name; The function writes hypervolumes to file in "./Objects/<name>"" |
hv_list |
A |
n |
Number of resamples to take. Used for every method. |
points_per_resample |
Number of points in each resample. If the input is |
cores |
Number of logical cores to use while generating bootstraped hypervolumes. If parallel backend already registered to |
verbose |
Logical value; If function is being run sequentially, outputs progress bar in console. |
seed |
Set seed for random number generation. |
hypervolume_n_resample()
creates a directory called Objects in the current working directory if a directory of that name doesn't already exist. A directory is then created for each hypervolume in hv_list
. Returns an absolute path to directory with resampled hypervolumes.
It is possible to access the hypervolumes by using readRDS to read the hypervolume objects one by one.
The resampled hypervolumes are generated using the same parameters used to generate the input hypervolume. The only exception is that the bandwidth is re-estimated if method = "gaussian"
or method = "box"
. See copy_param_hypervolume
for more details.
Returns a string containing an absolute path equivalent to ./Objects/<name>
hypervolume_n_occupancy_bootstrap
## Not run:
library(palmerpenguins)
data(penguins)
bill_data = na.omit(penguins[,3:4])
hv = hypervolume(bill_data)
# Example 1: get 50 resampled hypervolumes for each input hypervolume
# Use detectCores to see how many cores are availible in current environment
# Set cores = 1 to run sequentially (default)
# bootstrap the hypervolumes
hv_list_boot = hypervolume_n_resample(name = "example", hv_list, n = 50)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.