Book Image

R for Data Science

By : Toomey
Book Image

R for Data Science

By: Toomey

Overview of this book

If you are a data analyst who has a firm grip on some advanced data analysis techniques and wants to learn how to leverage the features of R, this is the book for you. You should have some basic knowledge of the R language and should know about some data science topics.
Table of Contents (14 chapters)

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...