O'Reilly logo

Mastering RStudio – Develop, Communicate, and Collaborate with R by Maximilian H. Nierhoff, Julian Hillebrand

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using ggplot2

In the next few pages, you will see how to apply the principles of the The Grammar of Graphics with the ggplot2 package. With this package, you are able to change a lot of details in your graphics and create your own individual style. We will give you examples of some of its main settings.

Installing the ggplot2 package

You can find the ggplot2 package on CRAN, which makes it very easy to install it:

install.packages("ggplot2")

You are then able to simply load it with the following:

library(ggplot2)

Or, you can just check the box in front of the package name in the packages pane of RStudio:

Installing the ggplot2 package

Qplot() and ggplot()

The ggplot2 package provides ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required