Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
R Programming Fundamentals

You're reading from  R Programming Fundamentals

Product type Book
Published in Sep 2018
Publisher
ISBN-13 9781789612998
Pages 206 pages
Edition 1st Edition
Languages
Author (1):
Kaelen Medeiros Kaelen Medeiros
Profile icon Kaelen Medeiros
Toc

Chapter 2: Data Visualization and Graphics

The following are the activity solutions for this chapter.

Activity: Recreating Plots with Base Plot Methods

The following code can be used to load the datasets library:

library(datasets)
install.packages("ggplot2")
library(ggplot2)

The following code can be used to load the data:

data("iris")
data("mpg")

The following code can be used to create a scatterplot to plot petal width without an axis label:

plot(iris$Petal.Width)

The following code can be used to create a scatterplot to plot petal width without axis labels:

plot(iris$Petal.Width, iris$Petal.Length,
main = "Petal Length vs. Petal Width",
xlab = "Petal Width",
ylab...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime