Bar Chart, or Bar Plot or Bar Graph
To create a bar chart in R
barplot
commandr = dnorm(seq(from=-3, to=3, length=15), mean=0, sd=1) barplot(r, col="red")
Bar Charts can also be used for comparing values of two and more variables
There are the following types of bar charts:
In R
library(openintro) data(email) # stacked t = table(email$spam, email$number) pal = c('yellow2', 'skyblue2') barplot(t, col=pal, beside=F) # proportional t.prop = rbind(t[1,] / colSums(t), t[2,] / colSums(t)) pal = c('yellow2', 'skyblue2') barplot(t.prop, col=pal, beside=F) # side-by-side barplot(t, col=pal, beside=T)
They can represent the information about the distribution better than proportional bar charts