Skip to Content
R Graphics Cookbook, 2nd Edition
book

R Graphics Cookbook, 2nd Edition

by Winston Chang
November 2018
Beginner to intermediate content levelBeginner to intermediate
441 pages
9h 25m
English
O'Reilly Media, Inc.
Content preview from R Graphics Cookbook, 2nd Edition

Chapter 1. R Basics

This chapter covers the basics: installing and using packages and loading data.

Most of the recipes in this book require the ggplot2, dplyr, and gcookbook packages to be installed on your computer. (The gcookbook package contains the data sets used in some of the examples, but is not necessary for doing your real work.) If you want to get started quickly, run:

install.packages("tidyverse")
install.packages("gcookbook")

Then, in each R session, before running the examples in this book, you can load them with:

library(tidyverse)
library(gcookbook)

Running library(tidyverse) will load ggplot2, dplyr, and a number of other packages. If you want to keep your R session more streamlined and load only the packages that are strictly needed, you can load the ggplot2 and dplyr packages individually:

library(ggplot2)
library(dplyr)
library(gcookbook)
Note

If you want a deeper understanding of how ggplot2 works, see Appendix A, which explains the concepts behind ggplot2.

Packages in R are collections of functions and/or data that are bundled up for easy distribution, and installing a package will extend the functionality of R on your computer. If an R user creates a package and thinks that it might be useful for others, that user can distribute it through a package repository. The primary repository for distributing R packages is called CRAN (the Comprehensive R Archive Network), but there are others, such as Bioconductor, which specializes in packages related to genomic ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R Graphics Cookbook

R Graphics Cookbook

Winston Chang
R Cookbook, 2nd Edition

R Cookbook, 2nd Edition

JD Long, Paul Teetor
R Statistics Cookbook

R Statistics Cookbook

Francisco Juretig

Publisher Resources

ISBN: 9781491978597Errata Page