Learn R Programming

edar (version 0.0.6)

gghist: Histogram wrapper for continuous covariates

Description

Create histograms for all numeric variables in a dataset. Non-numeric variables will be dropped.

Usage

gghist(d, cols, bins = 30, nsub = TRUE, ...)

Value

A ggplot object.

Arguments

d

<dfr> A data frame.

cols

<var> Optional. Columns to plot as a vector of unquoted names.

bins

<int> Number of bins.

nsub

<lgl> Show number of observations.

...

Additional arguments for ggplot2::geom_histogram.

Examples

Run this code
iris |> gghist()
iris |> gghist(c(Sepal.Width,Sepal.Length))

Run the code above in your browser using DataLab