June 2016
Beginner to intermediate
1783 pages
71h 22m
English
In this recipe, we will learn how to make bar plots that are useful to visualize summary data across various categories, such as sales of products or results of elections.
First, we need to load the citysales.csv example data file (you can download this file from the code download section of the book's companion website):
sales<-read.csv("citysales.csv",header=TRUE)Just like the plot() function we used to make scatter plots and line graphs in the earlier recipes, the barplot() and
dotchart() functions are part of the base graphics library in R. This means that we don't need to install any additional packages or libraries to use these functions.
We can make bar plots using the
barplot() function as ...
Read now
Unlock full access