Histograms are used to display the distribution of a single quantitative variable.

Histogram Using a Dataset

# Data from the cars dataset.  
hist(cars$dist, main="Distribution of Stopping Distancs", col="lightgreen", xlab="Distance (feet)", freq=TRUE) 

Histogram Using Your Own Data

Scores <- c(16, 43, 38, 48, 42, 23, 36, 35, 37, 34, 25, 28, 26, 43, 51, 33, 40, 35, 41, 42); 
hist(Scores, main="Distribution of Scores", col="cyan", xlab="Scores", freq=TRUE) 

Histogram Using ggplot2

library(ggplot2)
ggplot(data=cars, aes(x = dist)) + ggtitle("Distribution of Stopping Distancs") +  xlab("Distance (feet)") + geom_histogram( binwidth=20, fill="chartreuse3") 

Mathematicss, Computer Science, and Statistics Department Gustavus Adolphus College