September 2018
Beginner
206 pages
4h 27m
English
Let's create a bar chart with ggplot2 using both geom_bar() and geom_hist().
ggplot(msleep, aes(vore)) + geom_bar()
ggplot(msleep, aes(vore)) + geom_histogram(stat = "count")
Output: The following is the output we get after executing the code mentioned in Step 1:

The following is the output we get after executing the code mentioned in Step 2:
Read now
Unlock full access