Learn R Programming

rdiversity (version 2.0)

relativeentropy: Calculate relative entropy

Description

Functions to coerce an object into a relativeentropy (raw_beta() and/or norm_beta()).

Usage

relativeentropy(results, meta, tag)

# S4 method for relativeentropy show(object)

Arguments

results

data.frame containing rdiversity outputs associated with raw_beta() and/or norm_beta()

meta

object of class metacommunity containing the proportional abundance of types, pair-wise similarity, and other associated variables

tag

object of class character naming the diversity measure being calculated

object

object of class relativeentropy

Value

object of class relativeentropy

Fields

results

data.frame containing rdiversity outputs associated with raw_beta() and/or norm_beta()

measure

object of class character naming the diversity measure being calculated

type_abundance

two-dimensional matrix of mode numeric with rows as types (species), columns as subcommunities, and each element containing the relative abundance of types in each subcommunity relative to the metacommunity as a whole. In the phylogenetic case, this corresponds to the proportional abundance of historical species, which is calculated from the proportional abundance of terminal taxa

ordinariness

two-dimensional matrix of mode numeric with rows as types, columns as subcommunities, and elements containing the ordinariness of types within subcommunities

subcommunity_weights

vector of mode numeric containing subcommunity weights

type_weights

two-dimensional matrix of mode numeric, with rows as types, columns as subcommunities, and elements containing weights of types within a subcommunity

dat_id

object of class character describing the class of distance / similarity being used, e.g. "naive", "taxonomic", and so on

similarity_components

list containing the components necessary to calculate similarity. This list is empty when precompute_dist = TRUE when calculating distance. When a pairwise distance matrix is too large and precompute_dist = FALSE, this list contains all the information required to calculate pairwise distance between types

similarity_parameters

list containing parameters associated with converting pairwise distances to similarities (the dist2sim() arguments)

Examples

Run this code
# NOT RUN {
pop <- data.frame(a = c(1,3), b = c(1,1))
row.names(pop) <- paste0("sp", 1:2)
pop <- pop/sum(pop)
meta <- metacommunity(pop)

# Calculate raw subcommunity beta diversity
a <- raw_beta(meta)
class(a)

# }

Run the code above in your browser using DataLab