glottoplot | R Documentation |
This function offers different types of visualizations for linguistic data and linguistic distances.
glottoplot( glottodata = NULL, glottodist = NULL, type = NULL, glottonmds = NULL, color = NULL, ptsize = NULL, label = NULL, filename = NULL, palette = NULL, k = NULL, rm.na = FALSE, row2id = NULL, preventoverlap = FALSE, alpha = NULL, colorvec = NULL )
glottodata |
glottodata table |
glottodist |
A dist object created with |
type |
The type of plot: "heatmap", "nmds", or "missing". Default is heatmap if nothing is provided. |
glottonmds |
A glottonmds object created with |
color |
Name of variable to be used to color features (optional). Run glottovars() to see the options. |
ptsize |
Size of points between 0 and 1 (optional) |
label |
Name of variable to be used to label features (optional). Run glottovars() to see the options. |
filename |
Optional filename if output should be saved. |
palette |
Name of color palette, use glottocolpal("all") to see the options |
k |
Number of dimensions. Either 2 or 3 for nmds. |
rm.na |
Whether na's should be removed (default is FALSE) |
row2id |
In case of nmds, specify what each row contains (either 'glottocode' or 'glottosubcode') |
preventoverlap |
For nmds with 2 dimensions, should overlap between data points be prevented? |
alpha |
For nmds with 2 dimensions: Transparency of points between 0 (very transparent) and 1 (not transparent) |
colorvec |
Vector specifying colors for individual values and legend order (non-matching values are omitted), for example: c("Arawakan" = "rosybrown1", "Yucuna" = "red", "Tucanoan" = "lightskyblue1", "Tanimuca-RetuarĂ£" = "blue", "Naduhup" = "gray70", "Kakua-Nukak" = "gray30") See the 'values' argument in ggplot2::scale_color_manual() for details. |
a visualization of a glotto(sub)data, glottodist or glottonmds object, which can be saved with glottosave()
# Plot glottodist as nmds: glottodata <- glottoget("demodata", meta = TRUE) glottodist <- glottodist(glottodata = glottodata) glottoplot(glottodist = glottodist, type = "nmds", k = 3, color = "family", label = "name", row2id = "glottocode") # To create a stress/scree plot, you can run: # goeveg::dimcheckMDS(matrix = as.matrix(glottodist), k = k) # Plot missing data: glottodata <- glottoget("demodata", meta = TRUE) glottodata <- glottosimplify(glottodata) glottoplot(glottodata = glottodata, type = "missing")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.