mjs_histogram {metricsgraphics} | R Documentation |
Plot Histograms with MetrisGraphics
Description
Given a numeric vector or a data frame and numeric column name (bare or quoted),
plot a histogram with the specified parameter. This function automatically a y
axis label "Frequency" which you can override with a call to
mjs_labs
.
Usage
mjs_histogram(mjs, bar_margin = 1, bins = NULL)
Arguments
mjs |
metricsgraphics plot object |
bar_margin |
space between bars (defaults to |
bins |
numbenr of bins for the histogram ( |
Value
metricsgraphics plot object
Examples
movies <- ggplot2movies::movies[sample(nrow(ggplot2movies::movies), 1000), ]
mjs_plot(movies$rating) %>% mjs_histogram()
mjs_plot(movies, rating) %>%
mjs_histogram() %>%
mjs_labs(x_label="Histogram of movie ratings")
mjs_plot(movies$rating) %>%
mjs_histogram(bins=30)
mjs_plot(runif(10000)) %>%
mjs_histogram() %>%
mjs_labs(x_label="runif(10000)")
[Package metricsgraphics version 0.9.0 Index]