Learn R Programming

rdiversity (version 1.0)

relativeentropy: Calculate relative entropy

Description

Functions to check if an object is a relativeentropy, or coerse an object into a relativeentropy; for raw_beta() or norm_beta().

Usage

relativeentropy(results, meta, tag)

is.relativeentropy(x)

# S4 method for relativeentropy show(object)

Arguments

results

matrix of mode numeric; contains values calculated from diversity-term functions raw_beta() and norm_beta()

meta

object of class metacommunity

tag

measure

x

any R object

object

object of class relativeentropy

Value

object of class relativeentropy

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

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