Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
R Programming Fundamentals

You're reading from   R Programming Fundamentals Deal with data using various modeling techniques

Arrow left icon
Product type Paperback
Published in Sep 2018
Publisher
ISBN-13 9781789612998
Length 206 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Kaelen Medeiros Kaelen Medeiros
Author Profile Icon Kaelen Medeiros
Kaelen Medeiros
Arrow right icon
View More author details
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 $19.99/month. Cancel anytime