View source: R/plot_histogram.R
plot_histogram | R Documentation |
plot_histogram plots a histogram with a fitted kernel density plot and a normal
density plot. If no variable
(i.e. NULL) is defined, then for each column in the
data frame a histogram is plotted.
plot_histogram(data, variable = NULL, legend = TRUE)
data |
is a data frame containing all the data |
variable |
which variables (i.e. columns) to plot (see examples). |
legend |
is a boolean (default true) used to show the legend. |
ggplot showing a nice histogram
Rico Derks
set.seed(123) my_df <- data.frame(a = rnorm(100, mean = 10), b = rnorm(100, mean = 40), c = rnorm(1000, mean = 123)) # all variables plot_histogram(data = my_df) # only one plot_histogram(data = my_df, variable = a) # only two plot_histogram(data = my_df, variable = c(a, b)) # or using tidyverse approach library(dplyr) my_df %>% plot_histogram()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.