
Calculate Principal Coordinates using MDS, NMDS
Source:R/mStat_calculate_PC.R
mStat_calculate_PC.RdThis 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_diversityfunction. If NULL, beta diversity will be automatically computed fromdata.objusingmStat_calculate_beta_diversity.- method
Character string specifying the ordination method to use. Supported methods are "mds" (MDS) and "nmds" (NMDS). If multiple values are supplied, only the first is used.
- 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'.