View source: R/2.ord_ellipse_group.R
| ord_ellipse_group | R Documentation |
Calculates ellipse coordinates for one group in ordination scores with robust or classic covariance.
ord_ellipse_group(
scores,
group_var,
group_name,
axis1,
axis2,
kind = "se",
conf = 0.95,
method = "classic"
)
scores |
Data frame of ordination scores. |
group_var |
Name of grouping column. |
group_name |
Name of the group to calculate ellipse. |
axis1 |
Name of first axis column. |
axis2 |
Name of second axis column. |
kind |
Type of ellipse: "se" or "sd". |
conf |
Confidence level. |
method |
Covariance method: "classic" or "robust". |
Compute ellipse coordinates for a specific group in ordination scores
Calculates ellipse coordinates for one group from ordination scores, supporting classical or robust covariance estimation.
Data frame of ellipse coordinates with group label.
A data frame with ellipse coordinates and group label.
library(vegan)
data(dune)
data(dune.env)
pca <- rda(dune, scale = TRUE)
scores <- as.data.frame(scores(pca, display = "sites"))
scores$Group <- dune.env$Management
ell <- ord_ellipse_group(scores, "Group", "BF", "PC1", "PC2", kind = "se", method = "classic")
plot(ell$PC1, ell$PC2, type = "l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.