Description Usage Arguments Value Note
View source: R/helper_functions.R
plot histogram(ggplot style)
1 2 3 |
df |
A data.frame |
column |
(str) column to plot (column name) |
palette_defined |
(bool) indicate whether to use as named palette list as defined in palette. default = F: use ggplot default colour scheme |
palette |
[optional] (named str) define the colour of the factor levels |
plt_alpha |
[optional] (num) plot alpha (transparency), default = 0.4 |
group |
[optional] (str) fill colour by a column (column name), default is do not group by any column |
title |
[optional] (str) title of the plot, default none |
facet_gp |
[optional] (str) the column name for the facet group (as in facet_wrap()) |
x_angle |
[optional] (num) angle of x axis labels, default = 45 |
... |
other param in the ggplot2::geom_histogram() |
a ggplot histogram
use palette to define color for the factor levels. The palette list is a named list of colors. The names are corresponding to the factor levels e.g. palette <- c(red = "#ff0000", blue="#333BFF", pink ="#DD1C77", orange = "#CC6600", purple ="#9633FF",l_blue = "#00ffff", l_green = "#9bbc57", yellow = "#ffe700", salmon = "#ff7856",l_purple = "#e47fff")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.