histogram: Visualization of the distribution of a single variable using...

Description Usage Arguments Value Examples

View source: R/histogram.R

Description

This function displays the distribution of a single numeric variable through a histogram

Usage

1
histogram(data, x, xlab = "x", bins = 30, na.rm = TRUE)

Arguments

data

Default data set that supplies the data to generate the plot

x

Column that contains a vector of numbers to plot

xlab

Text that will be used for the title of the x axis

bins

Specify the number of bins. Defaults to 30 could change this value, exploring multiple numbers of bins to find the best to illustrate the stories in your data.

na.rm

A logical vector indicating whether NA values should be stripped before the computation proceeds. TRUE is the default.

Value

A histogram showing the distribution of x

Examples

1
2
3
4
library(gapminder)
histogram(gapminder, lifeExp)
histogram(gapminder, lifeExp, xlab = "Life Expectancy")
histogram(gapminder, gdpPercap, xlab = "GDP per capita", bins = 20)

cataralina/graph documentation built on Dec. 19, 2021, 1:55 p.m.