runPCoA | R Documentation |
This function performs PCoA analysis on a dataset using the specified distance metric, and optionally runs PERMANOVA (adonis2) and ANOSIM tests for group differences. It supports both data.frame and matrix inputs.
runPCoA(
data,
group,
k = 2,
distance = "bray",
adonis2 = TRUE,
anosim = TRUE,
simper = TRUE,
...
)
## S3 method for class 'data.frame'
runPCoA(
data,
group,
k = 2,
distance = "bray",
adonis2 = TRUE,
anosim = TRUE,
simper = TRUE,
...
)
## S3 method for class 'matrix'
runPCoA(
data,
group,
k = 2,
distance = "bray",
adonis2 = TRUE,
anosim = TRUE,
simper = TRUE,
...
)
## Default S3 method:
runPCoA(
data,
group,
k = 2,
distance = "bray",
adonis2 = TRUE,
anosim = TRUE,
simper = TRUE,
...
)
data |
|
group |
|
k |
Number of dimensions for PCoA (default: 2). |
distance |
Distance metric to use (default: "bray"). See |
adonis2 |
Logical; whether to perform PERMANOVA test using |
anosim |
Logical; whether to perform ANOSIM test using |
simper |
Logical; whether to perform SIMPER test using |
... |
Additional arguments passed to |
An object of class "PCoA" containing:
data - List containing the input data and group information
call - The function call
Points - Sample coordinates in the reduced space.
Eigenvalues - Variance explained by each principal coordinate axis.
adonis2 - PERMANOVA results (if adonis2 = TRUE)
anosim - ANOSIM results (if anosim = TRUE)
SIMPER - SIMPER results (if simper = TRUE)
cmdscale
for details on cmdscale implementation
vegdist
for available distance metrics
adonis2
for PERMANOVA
anosim
for ANOSIM
simper
for SIMPER
# Example with default Bray-Curtis distance
data <- data.frame(
Cephalobus = c(10, 20, 30, 1, 6, 5),
Eucephalobus = c(5, 10, 12, 30, 1, 6),
Acrobeloides = c(1, 2, 3, 12, 30, 1),
Caenorhabditis = c(5, 8, 15, 2, 3, 12),
Aphelenchus = c(5, 13, 11, 15, 2, 3),
Leptonchus = c(3, 10, 15, 0, 15, 11),
Pratylenchus = c(9, 2, 15, 15, 0, 15),
Tylenchus = c(5, 0, 15, 11, 15, 2),
Mesodorylaimus = c(7, 10, 18, 3, 12, 30),
Discolaimus = c(1, 10, 25, 10, 18, 3),
row.names = c("Sample1", "Sample2", "Sample3", "Sample4", "Sample5", "Sample6")
)
group_df <- data.frame(
group = c("A", "A", "B", "B", "C", "C"),
row.names = c("Sample1", "Sample2", "Sample3", "Sample4", "Sample5", "Sample6")
)
pcoa <- runPCoA(data, group = group_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.