Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
R Data Science Essentials

You're reading from  R Data Science Essentials

Product type Book
Published in Jan 2016
Publisher
ISBN-13 9781785286544
Pages 154 pages
Edition 1st Edition
Languages

Table of Contents (15) Chapters

R Data Science Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Getting Started with R Exploratory Data Analysis Pattern Discovery Segmentation Using Clustering Developing Regression Models Time Series Forecasting Recommendation Engine Communicating Data Analysis Index

Plotting


Let's plot and then see the sample dataset, sampdata. From the output, it is clear that the number of transactions is around 100 and number of items is around 500. The following code also includes saving the output to a local file in the current working directory:

Dataset

image(sampdata)
dev.copy(png,filename="sampdata.png", width=600, height=875);
dev.off ();

The output of the preceding command is as follows:

In the Adult dataset, the number of transactions is huge; if the number of items were fewer, it would appear as a straight line.

Rules

In order to plot the rule, we need to load the arulesviz package to the R environment. If this package is not already installed, use the install.packages function to install it:

install.packages("arulesViz")
library(arulesViz)

We can plot the rules using the plot function. This plot will have the support and confidence in the x axis and y axis, respectively, and the shading is used to represent the lift. We can also change the representation using...

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 $15.99/month. Cancel anytime}