pcl.pcoa | R Documentation |
This function performs Principal Coordinate Analysis (PCoA) on the input data or distance matrix.
pcl.pcoa(dat, D = NA, as = FALSE, asinsqrt = as, index = "bray/curtis", k = 2)
dat |
A list containing at least an element 'x' which is the data matrix. |
D |
Distance matrix. If NA, it will be computed from dat$x. Default is NA. |
as |
Logical. If TRUE, performs arcsine transformation (deprecated parameter). Default is FALSE. |
asinsqrt |
Logical. If TRUE, performs arcsine square root transformation. Default is the value of 'as'. |
index |
Character string specifying the distance index to use when computing D. Default is "bray/curtis". |
k |
Integer. The number of dimensions for PCoA. Must be at least 2. Default is 2. |
If a distance matrix D is not provided, the function computes it from the input data using the specified index. If asinsqrt is TRUE, the data is transformed using an arcsine square root transformation before computing distances. The PCoA is then performed on the distance matrix.
A list containing PCoA results, including:
points |
A matrix of PCoA coordinates |
eig |
Eigenvalues |
ordnames |
A character vector of dimension names with variance explained |
This function requires the 'vegan', 'labdsv', and 'ecodist' packages.
## Not run:
data <- list(x = matrix(rnorm(1000), ncol = 10))
rownames(data$x) <- paste0("Sample", 1:100)
result <- pcl.pcoa(data, k = 3)
plot(result$points[,1], result$points[,2], main = "PCoA plot")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.