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 for Data Science

You're reading from   R for Data Science Learn and explore the fundamentals of data science with R

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781784390860
Length 364 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Dan Toomey Dan Toomey
Author Profile Icon Dan Toomey
Dan Toomey
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Scatter plots


A scatter plot is a basic plotting device comparing datasets with two axes. A basic scatter plot is provided with the plot function built into the R system.

Note

Several objects available in R and packages have their own plot function in order to effectively portray the data associated.

The plot function looks as follows:

plot(x,
   y,
   type,
   main,
   sub,
   xlab,
   ylab,
   asp)

The various parameters of this function are described in the following table:

Parameter

Description

x

This is an independent variable.

y

This is a dependent variable.

type

This defines the type of plot. It should be one of the following types:

  • p for points

  • l for lines

  • b for both

  • c for the lines part alone of b

  • o for both overplotted

  • h for histogram-like (or high-density) vertical lines

  • s for stair steps

  • S for other steps, see details below

  • n for no plotting (not sure why this is a choice as it ends up with no information plotted)

main

This is the title of the plot.

sub

This...

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