Learn R Programming

rdiversity (version 2.0)

powermean: Calculate power mean

Description

Functions to coerce an object into a powermean (raw_alpha(), norm_alpha(), raw_rho(), norm_rho(), and/or raw_gamma()).

Usage

powermean(results, meta, tag)

# S4 method for powermean show(object)

Arguments

results

data.frame containing rdiversity outputs associated with norm_alpha(), raw_alpha(), raw_rho(), norm_rho(), and/or raw_gamma()

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 powermean

Value

powermean(x) returns an object of class powermean.

print(x) prints an object object of class powermean

Fields

results

data.frame containing rdiversity outputs associated with norm_alpha(), raw_alpha(), raw_rho(), norm_rho(), and/or raw_gamma()

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 subcommunity raw alpha diversity (takes the powermean)
a <- raw_alpha(meta)
class(a)

# }

Run the code above in your browser using DataLab