View source: R/func_structure_plot.R
structure_plot | R Documentation |
Plot a traditional STRUCTURE barplot or a facet barplot from individual admixture proportions.
structure_plot(
admixture_df,
type = "structure",
cluster_cols = NULL,
cluster_names = NULL,
legend = "none",
labels = "site",
flip_axis = FALSE,
ylabel = "Proportion",
site_dividers = TRUE,
divider_width = 1,
divider_col = "white",
divider_type = "dashed",
site_order = NULL,
display_site_labels = TRUE,
site_labels_size = 2,
site_labels_x = 0,
site_labels_y = -0.025,
site_labels_angle = 0,
site_ticks = TRUE,
site_ticks_size = -0.01,
facet_col = NULL,
facet_row = NULL
)
admixture_df |
data.frame or tibble containing admixture data (see examples). |
type |
show a traditional STRUCTURE barplot ("structure") or a facet barplot ("facet"). |
cluster_cols |
character vector of colours the same length as the number of clusters.
If |
cluster_names |
character vector of names the same length as the number of clusters.
If |
legend |
add legend at position ( |
labels |
show labels at the site level or the individual level ("site" or "individual"). |
flip_axis |
flip the axes so that the plot is vertical (TRUE or FALSE). Default is FALSE (horizontal barplot). |
ylabel |
string for y label. |
site_dividers |
add dotted lines that divide sites (TRUE or FALSE). |
divider_width |
width of site divider lines. |
divider_col |
colour of site divider lines. |
divider_type |
linetype of site divider line. |
site_order |
character vector of site labels used to customise the order of sites.
If |
display_site_labels |
display site labels (TRUE or FALSE). |
site_labels_size |
numeric value for site label size. |
site_labels_x |
numeric value for site label horizontal position. |
site_labels_y |
numeric value for site label vertical position. |
site_labels_angle |
numeric value for rotating angle of site label. |
site_ticks |
show ticks when labels = "site". |
site_ticks_size |
numeric value for site tick size. |
facet_col |
number of columns to display for facet barplot. |
facet_row |
number of rows to display for facet barplot. |
A ggplot object.
# Admixture Format 1
file <- system.file("extdata", "admixture1.csv", package = "mapmixture")
admixture1 <- read.csv(file)
structure_plot(admixture1, type = "structure")
structure_plot(admixture1, type = "facet", facet_col = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.