Description Usage Arguments Value Examples
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
.
1 | mjs_histogram(mjs, bar_margin = 1, bins = NULL)
|
mjs |
metricsgraphics plot object |
bar_margin |
space between bars (defaults to |
bins |
numbenr of bins for the histogram ( |
metricsgraphics plot object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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)")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.