Learn R Programming

diverse (version 0.1.1)

dis_categories: A procedure to create a disparity matrix between categories.

Description

Takes a data frame or a matrix to create a disparity matrix

Usage

dis_categories(data, method = "euclidean", 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
method
A distance or dissimilarity method available in "proxy" package as for example "Euclidean", "Kullback" or "Canberra". This parameter also accepts a similarity method available in the "proxy" package, as for example: "cosine", "correlation" or "Jaccard" am
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 distance or dissimilarity square matrix

Examples

Run this code
Xdis <- dis_categories(pantheon)

Run the code above in your browser using DataLab