get.matrix: Extract elements from a 'dispRity' object.

View source: R/dispRity.utilities.R

get.matrixR Documentation

Extract elements from a dispRity object.

Description

Extract a matrix or the disparity results from a dispRity.

Usage

get.matrix(data, subsets, rarefaction, bootstrap, matrix)

get.disparity(data, subsets, rarefaction, observed, concatenate)

Arguments

data

A dispRity object.

subsets

Optional, a numeric or character for which subsets to get (if missing, the value for all subsets are given).

rarefaction

Optional, a single numeric value corresponding to the rarefaction level (as the number of elements; if missing, the non-rarefied values are output).

bootstrap

Optional, a numeric value to select a specific bootstrap draw (0 is no bootstrap).

matrix

A numeric value of which matrix to select (default is 1).

observed

A logical value indicating whether to output the observed (TRUE (default)) or the bootstrapped values (FALSE).

concatenate

When the disparity metric is a distribution, whether to concatenate it returning the median (TRUE; default) or to return each individual values.

Author(s)

Thomas Guillerme

See Also

dispRity, get.subsets.

Examples

## Load the disparity data based on Beck & Lee 2014
data(disparity)

## To get the original matrix
get.matrix(disparity)

## To get the un-bootstrapped matrix from the subset called "80"
get.matrix(disparity, subsets = "80")

## To get the 52nd bootstrap draw of the second rarefaction level (15) of the
## same subset
get.matrix(disparity, subsets = 2, rarefaction = 2, bootstrap = 52)

## Extracting the observed disparity
get.disparity(disparity)

## Extracting the bootstrapped disparity
boot_disp <- get.disparity(disparity, observed = FALSE)
str(boot_disp)
## Or only the rarefied (5) data
boot_disp_rare <- get.disparity(disparity, observed = FALSE,
     rarefaction = 5)


TGuillerme/dispRity documentation built on Nov. 16, 2024, 1:49 a.m.