histogram_from_hist {kim} | R Documentation |
Histogram from hist function
Description
Create a histogram based on the output of the hist
function
in the graphics
package.
Usage
histogram_from_hist(
vector = NULL,
breaks = NULL,
counts = NULL,
percent = FALSE,
bin_fill_color = "green4",
bin_border_color = "black",
bin_border_thickness = 1,
notify_na_count = NULL,
x_axis_tick_marks = NULL,
y_axis_tick_marks = NULL,
cap_axis_lines = TRUE,
x_axis_title = "Value",
y_axis_title = NULL,
y_axis_title_vjust = 0.85
)
Arguments
vector |
a numeric vector |
breaks |
a numeric vector indicating breaks for the bins. By default, no input is required for this argument. |
counts |
a numeric vector containing counts for the bins (i.e., heights of the bins). By default, no input is required for this argument. |
percent |
logical. If |
bin_fill_color |
color of the area inside each bin (default = "green4") |
bin_border_color |
color of the border around each bin (default = "black") |
bin_border_thickness |
thickness of the border around each bin (default = 1) |
notify_na_count |
if |
x_axis_tick_marks |
a vector of values at which to place tick marks
on the x axis (e.g., setting |
y_axis_tick_marks |
a vector of values at which to place tick marks
on the y axis (e.g., setting |
cap_axis_lines |
logical. Should the axis lines be capped at the outer tick marks? (default = FALSE) |
x_axis_title |
title for x axis (default = "Value") |
y_axis_title |
title for y axis (default = "Count" or "Percentage",
depending on the value of |
y_axis_title_vjust |
position of the y axis title (default = 0.85). |
Value
the output will be a histogram, a ggplot object.
Examples
histogram_from_hist(1:100)
histogram_from_hist(c(1:100, NA))
histogram_from_hist(vector = mtcars[["mpg"]])
histogram_from_hist(vector = mtcars[["mpg"]], percent = TRUE)
histogram_from_hist(vector = mtcars[["mpg"]],
x_axis_tick_marks = c(10, 25, 35), y_axis_title_vjust = 0.5,
y_axis_title = "Freq", x_axis_title = "Values of mpg")