hypervolumes: CALCULATE AND COMPARE TWO HYPERVOLUMES

View source: R/Hypervolumes_functions.R

hypervolumesR Documentation

CALCULATE AND COMPARE TWO HYPERVOLUMES

Description

Calculates two hypervolumes on two sets of "raw" data or on the factor scores of an ordination done on the entire dataset (across the two sets of data).

Usage

hypervolumes(
  HVdata1,
  HVdata2,
  HVidvar,
  ordination = "PCA",
  init.vars = NULL,
  noAxes = NULL,
  do.scale = FALSE,
  HVmethod = "box",
  freeBW = FALSE,
  bwHV1 = NULL,
  bwHV2 = NULL,
  no.runs = 1,
  plotOrdi = TRUE,
  plotHV = TRUE,
  saveOrdi = FALSE,
  saveOrdiSumm = TRUE,
  outputs.dir,
  file.suffix,
  verbose = TRUE,
  plotHVDots = NULL,
  ...
)

Arguments

HVdata1

the data.table (or a object that can be converted to data.table) from which the first hypervolume will be calculated

HVdata2

the data.table (or a object that can be converted to data.table) from which the second hypervolume will be calculated. HVdata1 and HVdata2 must have the same column names and ideally the same number of rows.

HVidvar

the name or number of the column (in HVdata1/2) containing the ID of each hypervolume.

ordination

determines whether hypervolumes will be calculated on the raw data ("none") of on ordination factor scores (one of "PCA", "HillSmith", "dudi.mix"). Defaults to using a PCA.

init.vars

is a vector with the variable indices (column numbers) to use. Defaults to NULL and all variables are used - ATTENTION the user should not have more than 8 variables unless using an ordination to reduce dimensionality. See Blonder et al 2014.

noAxes

determines the number of axes/columns to use for hypervolume calculation

do.scale

activates scaling prior to the ordination/calculation of HVs

HVmethod

determines the method used to calculate hypervolumes - passed to hypervolume::hypervolume method argument

freeBW

determines whether a bandwidth estimator will be used to calculate bandwith per variable. Only used if HVmethod is "box" or "gaussian".

bwHV1

determines the bandwidth value for first hypervolume. Only used if freeBW is FALSE. see hypervolume::hypervolume Only used if HVmethod is "box" or "gaussian".

bwHV2

determines the bandwidth value for second hypervolume. Only used if freeBW is FALSE. see hypervolume::hypervolume Only used if HVmethod is "box" or "gaussian".

no.runs

determines how many times the HV calculations and comparisons are repeated

plotOrdi

activates/desactivates plotting for ordinations - plots are saved to PDFs not plotted interactively

plotHV

activates/desactivates plotting for hypervolumes - plots are saved to PDFs not plotted interactively

saveOrdi

activates/deactivates saving ordination object

saveOrdiSumm

activates/deactivates saving ordination summary outputs

outputs.dir

is the directory to store results

file.suffix

is a character string used as a suffix in file names

verbose

is passed to ⁠hypervolume::*⁠ functions to control printing of diagnostic outputs

plotHVDots

a list of further arguments passed to hypervolume:::plot.HypervolumeList.

...

further arguments passed to hypervolume::hypervolume.

Value

Nothing is returned. Hypervolumes and comparisons are saved outputs.dir


CeresBarros/ToolsCB documentation built on Aug. 23, 2024, 4:22 p.m.