space_size | R Documentation |
space_size
space_size(
formula,
data,
cores = 1,
method = "mcp",
pb = TRUE,
outliers = 0.95,
...
)
formula |
an object of class "formula" (or one that can be coerced to that class).Must follow the form |
data |
Data frame containing columns for the dimensions of the phenotypic space (numeric) and a categorical or factor column with group labels. |
cores |
Numeric vector of length 1. Controls whether parallel computing is applied by specifying the number of cores to be used. Default is 1 (i.e. no parallel computing). |
method |
Character vector of length 1. Controls the method to be used for quantifying space size. Three metrics are available:
|
pb |
Logical argument to control if progress bar is shown. Default is |
outliers |
Numeric vector of length 1. A value between 0 and 1 controlling the proportion of outlier observations to be excluded. Outliers are determined as those farthest away from the sub-space centroid. |
... |
Additional arguments to be passed to |
The function quantifies the size of the phenotypic sub-spaces.
A data frame containing the phenotypic space size for each group.
Marcelo Araya-Salas marcelo.araya@ucr.ac.cr)
Araya-Salas, M, & K. Odom. 2022, PhenotypeSpace: an R package to quantify and compare phenotypic trait spaces R package version 0.1.0.
rarefact_space_size
, space_size_difference
, rarefact_space_size_difference
{
# load data
data("example_space")
# plot data
xs <- tapply(example_space$dimension_1, example_space$group, mean)
ys <- tapply(example_space$dimension_2, example_space$group, mean)
plot(example_space[, c("dimension_1", "dimension_2")],
col = example_space$color, pch = 20, cex = 1.8)
text(xs, ys, labels = names(xs), cex = 2.5)
# MCP spaces
space_size(
formula = group ~ dimension_1 + dimension_2,
data = example_space,
method = "mcp")
# MST
space_size(
formula = group ~ dimension_1 + dimension_2,
data = example_space,
method = "mst")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.