Histograms
Learn about the use cases for histogram charts and how to create and modify them.
We'll cover the following...
Features
We use a histogram to graphically represent the distribution of a dataset and visualize how the data is spread across a range of values. The histogram shows the count or frequency of observations in each interval or bin of the data.
To create a histogram, we divide the range of the data into a series of equally spaced intervals or bins and then display the frequency or count of observations in each bin as a vertical bar or column. The height of each bar represents the frequency of observations within that particular bin, while the width of the bin determines the range of values included in the bin.
Histograms with hist()
The default function in R for creating histograms is hist()
. We can create a histogram by supplying a numerical dataset to the function. Here is the code structure for a simple histogram.
# Syntax structure
hist(<data>)
In the example below, we create a histogram from the Wind
...