Learn R Programming

rdiversity (version 1.0)

powermean: Calculate power mean

Description

Functions to check if an object is a powermean, or coerse an object into a powermean; for raw_alpha(), norm_alpha(), raw_rho(), norm_rho(), or raw_gamma().

Usage

powermean(results, meta, tag)

is.powermean(x)

# S4 method for powermean show(object)

Arguments

results

matrix of mode numeric; contains values calculated from diversity-term functions norm_alpha(), raw_alpha(), raw_rho(), norm_rho(), and raw_gamma()

meta

object of class metacommunity; contains proportional abundance of types, pair-wise similarity, and other associated variables.

tag

measure

x

any R object

object

object of class powermean

Value

powermean(x) returns an object of class powermean.

is.powermean(x) returns TRUE if its argument is a powermean, FALSE otherwise.

print(x) prints an object object of class powermean

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