Calculate Principal Coordinates using MDS, NMDS
Source:R/mStat_calculate_PC.R
mStat_calculate_PC.Rd
This function calculates the Principal Coordinates based on different methods such as Metric Multi-Dimensional Scaling (MDS), Non-Metric Multi-Dimensional Scaling (NMDS)
Usage
mStat_calculate_PC(dist.obj, method = c("mds"), k = 2, dist.name = NULL)
Arguments
- dist.obj
Distance matrix between samples, usually calculated using
mStat_calculate_beta_diversity
function. If NULL, beta diversity will be automatically computed fromdata.obj
usingmStat_calculate_beta_diversity
.- method
A character vector specifying which methods to use for calculating PCoA. Supported methods are "mds" (MDS), "nmds" (NMDS)
- k
An integer specifying the number of principal coordinates to retain. Default is 2.
- dist.name
A character vector specifying which beta diversity indices to calculate. Supported indices are "BC" (Bray-Curtis), "Jaccard", "UniFrac" (unweighted UniFrac), "GUniFrac" (generalized UniFrac), "WUniFrac" (weighted UniFrac), and "JS" (Jensen-Shannon divergence). If a name is provided but the corresponding object does not exist within dist.obj, it will be computed internally. If the specific index is not supported, an error message will be returned. to be used from the dist.obj list. Default is 'BC'.