View source: R/barplot_three_way_count.R
A function that plots a three way barplot with labels (counts) see example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | threeway_barplot_count(
df,
x_variable,
y_variable,
groupby_variable,
title,
xlablabel = "",
ylablabel = "Percent",
scale_values = c(`My spouse` = "#66AAD7", `My spouse & I` = "#0071BC", Myself =
"#00558D", `Refuse to answer` = "#CCE3F2"),
sizee = 12,
angle = 0,
sizelabel = 3
)
|
df |
A data frame with x variable, y variable and the factor variable. |
x_variable |
the variable that will form the x-axis |
y_variable |
the variable that will form the y-axis |
groupby_variable |
the factor variable that holds the groupings |
title |
the title of the plot |
xlablabel |
the x label of the plot @param ylablabel the y label of the plot @param scale_values Specify the factor groups with the colours you would like them to take eg "MMale" = "#66AAD7" @param sizee the size of title @param angle the of lables @param sizelabel the size of labels |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.