| plot_overlap_metrics | R Documentation |
Visualizes the output of phontrast() with ggplot2.
The input may be either wide or long output. By default, values are plotted on
a separation-oriented scale so overlap-oriented metrics are transformed as
1 - estimate.
plot_overlap_metrics(
metrics,
value = c("separation", "estimate"),
metric = NULL,
group_col = NULL,
show_ci = TRUE,
facet = TRUE,
sort = TRUE
)
metrics |
Data frame returned by |
value |
Scale to plot: |
metric |
Optional character vector of metric display names to include. |
group_col |
Optional column to use on the x-axis. Defaults to
|
show_ci |
Logical; if |
facet |
Logical; if |
sort |
Logical; if |
A ggplot2 plot object.
set.seed(2026)
vowels <- data.frame(
speaker = rep(c("s01", "s02"), each = 60),
vowel = rep(rep(c("ih", "eh"), each = 30), 2),
f1 = c(rnorm(30, 500, 55), rnorm(30, 560, 60),
rnorm(30, 510, 60), rnorm(30, 575, 65)),
f2 = c(rnorm(30, 1980, 150), rnorm(30, 1880, 155),
rnorm(30, 1960, 160), rnorm(30, 1840, 165))
)
metrics <- phontrast(
vowels,
features = c("f1", "f2"),
category_col = "vowel",
group_col = "speaker",
output = "long"
)
if (requireNamespace("ggplot2", quietly = TRUE)) {
plot_overlap_metrics(metrics)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.