Welcome to the barplot section of the R graph gallery. A barplot is used to display the relationship between a numeric and a categorical variable. This section also include stacked barplot and grouped barplot where two levels of grouping are shown.
ggplot2
and geom_bar()
ggplot2
allows to build barplot thanks to the geom_bar()
function. The examples below will guide you through the basics of this tool:
barplot()
functionBasic R can build quality barplots thanks to the barplot()
function. Here is a list of examples guiding you through the most common customization you will need.