View source: R/fava_functions.R
fava_norm | R Documentation |
This function computes the normalized Fst given the number of rows and the mean abundance of the most abundant category. We employ the normalization employed in the FSTruct package by Morrison, Alcala, and Rosenberg (2020) \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.1111/1755-0998.13647")}.
fava_norm(relab_matrix, K = ncol(relab_matrix))
relab_matrix |
A matrix or data frame with rows containing non-negative entries that sum to 1. Each row represents
a sample, each column represents a category, and each entry represents the abundance of that category in the sample.
If |
K |
Optional; an integer specifying the number of categories in the data. Default is |
A numeric value between 0 and 1.
# Compute the weighted fava of
# the following compositional vectors:
q1 = c(1, 0, 0, 0)
q2 = c(0.5, 0.5, 0, 0)
q3 = c(1/4, 1/4, 1/4, 1/4)
q4 = c(0, 0, 1, 0)
relative_abundances = matrix(c(q1, q2, q3, q4),
byrow = TRUE, nrow = 4)
fava_norm(relative_abundances)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.