Learn R Programming

diverse (version 0.1.1)

variety: Variety or Richness

Description

Computes the variety (number of distinct types) or simple diversity of an entity. It is also known as richness.

Usage

variety(data, sort = TRUE, decreasing = TRUE, category_row = FALSE)

Arguments

data
A numeric matrix with entities $i$ in the rows and categories $j$ in the columns. Cells show the respective value (value of abundance) of entity $i$ in the category $j$. It can also be a transpose of the previous matrix, that is, a matrix with categories
sort
Indicates whether results should be ordered or not. Define it to FALSE to avoid ordering.
decreasing
If parameter "sort" is set to TRUE, this parameter indicates descending order. The default value is TRUE.
category_row
A flag to indicate that categories are in the rows. The analysis assumes that the categories are in the columns of the matrix. If the categories are in the rows and the entities in the columns, then the parameter "category_row" has to be set to TRUE. The

Value

  • A dataframe with values of variety for each entity.

Examples

Run this code
variety(data=pantheon)
variety(data=pantheon, sort=FALSE)

Run the code above in your browser using DataLab