This project is the continuation of video game project.

The link to this project part 1 is: https://rpubs.com/S_ubin10/809024

The link to project part 2 is: https://rpubs.com/S_ubin10/820757

library(readxl)
library(rvest)
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✓ ggplot2 3.3.5     ✓ purrr   0.3.4
## ✓ tibble  3.1.4     ✓ dplyr   1.0.7
## ✓ tidyr   1.1.4     ✓ stringr 1.4.0
## ✓ readr   2.0.2     ✓ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter()         masks stats::filter()
## x readr::guess_encoding() masks rvest::guess_encoding()
## x dplyr::lag()            masks stats::lag()
df = read_excel("videogames.xlsx") 
smalldf <- sample_n (df,150)
head(smalldf)
## # A tibble: 6 × 11
##    Rank Name        Platform Year  Genre  Publisher   NA_Sales EU_Sales JP_Sales
##   <dbl> <chr>       <chr>    <chr> <chr>  <chr>          <dbl>    <dbl>    <dbl>
## 1  8219 Monkey Isl… PC       2011  Adven… LucasArts       0        0.14        0
## 2 13618 The Sims 2… PC       2006  Simul… Electronic…     0.01     0.02        0
## 3 15248 Jewel Mast… DS       2011  Puzzle Rising Sta…     0        0.02        0
## 4  8839 Spider-Man… Wii      2007  Action Activision      0.13     0.01        0
## 5  3023 Spice World PS       1998  Action Sony Compu…     0.37     0.25        0
## 6  3436 FIFA Socce… DS       2009  Sports Electronic…     0.14     0.37        0
## # … with 2 more variables: Other_Sales <dbl>, Global_Sales <dbl>

We need some new libraries for this project. So installing some new libraries.

library(arules)
## Loading required package: Matrix
## 
## Attaching package: 'Matrix'
## The following objects are masked from 'package:tidyr':
## 
##     expand, pack, unpack
## 
## Attaching package: 'arules'
## The following object is masked from 'package:dplyr':
## 
##     recode
## The following objects are masked from 'package:base':
## 
##     abbreviate, write
library(arulesViz)
transactions(smalldf)
## Warning: Column(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 not logical or factor.
## Applying default discretization (see '? discretizeDF').
## Warning in discretize(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : The calculated breaks are: 0, 0, 0.01, 0.74
##   Only unique breaks are used reducing the number of intervals. Look at ? discretize for details.
## Warning in discretize(x = c(0.04, 0.01, 0, 0.01, 0.04, 0.07, 0, 0.05, 0.1, : The calculated breaks are: 0, 0, 0.02, 0.34
##   Only unique breaks are used reducing the number of intervals. Look at ? discretize for details.
## transactions in sparse format with
##  150 transactions (rows) and
##  289 items (columns)

I got lots of errors so lets check what columns we got error on. This includes all the column in our dataset.

colnames(smalldf)[c(2,4,5,6,7)]
## [1] "Name"      "Year"      "Genre"     "Publisher" "NA_Sales"
trans <- transactions(smalldf)
## Warning: Column(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 not logical or factor.
## Applying default discretization (see '? discretizeDF').
## Warning in discretize(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : The calculated breaks are: 0, 0, 0.01, 0.74
##   Only unique breaks are used reducing the number of intervals. Look at ? discretize for details.
## Warning in discretize(x = c(0.04, 0.01, 0, 0.01, 0.04, 0.07, 0, 0.05, 0.1, : The calculated breaks are: 0, 0, 0.02, 0.34
##   Only unique breaks are used reducing the number of intervals. Look at ? discretize for details.
summary(trans)
## transactions as itemMatrix in sparse format with
##  150 rows (elements/itemsets/transactions) and
##  289 columns (items) and a density of 0.03806228 
## 
## most frequent items:
##        JP_Sales=[0,0.01)     Other_Sales=[0,0.02) Global_Sales=[0.07,0.24) 
##                       99                       98                       57 
##     NA_Sales=[0.01,0.13)     EU_Sales=[0.05,1.26]                  (Other) 
##                       52                       52                     1292 
## 
## element (itemset/transaction) length distribution:
## sizes
##  11 
## 150 
## 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##      11      11      11      11      11      11 
## 
## includes extended item information - examples:
##                     labels variables              levels
## 1      Rank=[879,6.89e+03)      Rank      [879,6.89e+03)
## 2 Rank=[6.89e+03,1.19e+04)      Rank [6.89e+03,1.19e+04)
## 3 Rank=[1.19e+04,1.64e+04]      Rank [1.19e+04,1.64e+04]
## 
## includes extended transaction information - examples:
##   transactionID
## 1             1
## 2             2
## 3             3

This shows the most frequent item in the data set which is EU_Sales and JP_Sales. These items occurred 100 times each. This summary also shows the mean, 1st quater ,median, mean and max which is suprisinly 11 in all of them.

head(colnames(trans))
## [1] "Rank=[879,6.89e+03)"                                             
## [2] "Rank=[6.89e+03,1.19e+04)"                                        
## [3] "Rank=[1.19e+04,1.64e+04]"                                        
## [4] "Name=A Collection of Activision Classic Games for the Atari 2600"
## [5] "Name=Accel World: Ginyoku no Kakusei"                            
## [6] "Name=Adventure Time: Explore the Dungeon Because I Don't Know!"
inspect(trans[1:3])
##     items                                            transactionID
## [1] {Rank=[6.89e+03,1.19e+04),                                    
##      Name=Monkey Island: Special Edition Collection,              
##      Platform=PC,                                                 
##      Year=2011,                                                   
##      Genre=Adventure,                                             
##      Publisher=LucasArts,                                         
##      NA_Sales=[0,0.01),                                           
##      EU_Sales=[0.05,1.26],                                        
##      JP_Sales=[0,0.01),                                           
##      Other_Sales=[0.02,0.34],                                     
##      Global_Sales=[0.07,0.24)}                                   1
## [2] {Rank=[1.19e+04,1.64e+04],                                    
##      Name=The Sims 2: Pets,                                       
##      Platform=PC,                                                 
##      Year=2006,                                                   
##      Genre=Simulation,                                            
##      Publisher=Electronic Arts,                                   
##      NA_Sales=[0.01,0.13),                                        
##      EU_Sales=[0.01,0.05),                                        
##      JP_Sales=[0,0.01),                                           
##      Other_Sales=[0,0.02),                                        
##      Global_Sales=[0.01,0.07)}                                   2
## [3] {Rank=[1.19e+04,1.64e+04],                                    
##      Name=Jewel Master: Cradle Of Rome 2,                         
##      Platform=DS,                                                 
##      Year=2011,                                                   
##      Genre=Puzzle,                                                
##      Publisher=Rising Star Games,                                 
##      NA_Sales=[0,0.01),                                           
##      EU_Sales=[0.01,0.05),                                        
##      JP_Sales=[0,0.01),                                           
##      Other_Sales=[0,0.02),                                        
##      Global_Sales=[0.01,0.07)}                                   3
image(trans)

This shows how sparse the data is. The black dots are where it returns true and white parts are where it was false.

itemFrequencyPlot(trans,topN = 20)

The graphical representation above shows relative frequency of EU_Sales, JP_Sales is the highest among other data sets. whereas sports genre games have the lowest relative frequency in the dataset.

vertical <- as(trans, "tidLists")
as(vertical, "matrix")[1:10, 1:5]
##                                                                      1     2
## Rank=[879,6.89e+03)                                              FALSE FALSE
## Rank=[6.89e+03,1.19e+04)                                          TRUE FALSE
## Rank=[1.19e+04,1.64e+04]                                         FALSE  TRUE
## Name=A Collection of Activision Classic Games for the Atari 2600 FALSE FALSE
## Name=Accel World: Ginyoku no Kakusei                             FALSE FALSE
## Name=Adventure Time: Explore the Dungeon Because I Don't Know!   FALSE FALSE
## Name=Angry Birds Star Wars                                       FALSE FALSE
## Name=Arcana Heart 3                                              FALSE FALSE
## Name=Armorines: Project S.W.A.R.M.                               FALSE FALSE
## Name=Army Men World War: Team Assault                            FALSE FALSE
##                                                                      3     4
## Rank=[879,6.89e+03)                                              FALSE FALSE
## Rank=[6.89e+03,1.19e+04)                                         FALSE  TRUE
## Rank=[1.19e+04,1.64e+04]                                          TRUE FALSE
## Name=A Collection of Activision Classic Games for the Atari 2600 FALSE FALSE
## Name=Accel World: Ginyoku no Kakusei                             FALSE FALSE
## Name=Adventure Time: Explore the Dungeon Because I Don't Know!   FALSE FALSE
## Name=Angry Birds Star Wars                                       FALSE FALSE
## Name=Arcana Heart 3                                              FALSE FALSE
## Name=Armorines: Project S.W.A.R.M.                               FALSE FALSE
## Name=Army Men World War: Team Assault                            FALSE FALSE
##                                                                      5
## Rank=[879,6.89e+03)                                               TRUE
## Rank=[6.89e+03,1.19e+04)                                         FALSE
## Rank=[1.19e+04,1.64e+04]                                         FALSE
## Name=A Collection of Activision Classic Games for the Atari 2600 FALSE
## Name=Accel World: Ginyoku no Kakusei                             FALSE
## Name=Adventure Time: Explore the Dungeon Because I Don't Know!   FALSE
## Name=Angry Birds Star Wars                                       FALSE
## Name=Arcana Heart 3                                              FALSE
## Name=Armorines: Project S.W.A.R.M.                               FALSE
## Name=Army Men World War: Team Assault                            FALSE
trans
## transactions in sparse format with
##  150 transactions (rows) and
##  289 items (columns)
trans_Sports <- trans[trans %in% "Genre=Sports"]
trans_Sports
## transactions in sparse format with
##  22 transactions (rows) and
##  289 items (columns)
inspect(trans_Sports)
##      items                                             transactionID
## [1]  {Rank=[879,6.89e+03),                                          
##       Name=FIFA Soccer 10,                                          
##       Platform=DS,                                                  
##       Year=2009,                                                    
##       Genre=Sports,                                                 
##       Publisher=Electronic Arts,                                    
##       NA_Sales=[0.13,1.29],                                         
##       EU_Sales=[0.05,1.26],                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0.02,0.34],                                      
##       Global_Sales=[0.24,1.94]}                                  6  
## [2]  {Rank=[879,6.89e+03),                                          
##       Name=NBA Showtime: NBA on NBC,                                
##       Platform=N64,                                                 
##       Year=1999,                                                    
##       Genre=Sports,                                                 
##       Publisher=Midway Games,                                       
##       NA_Sales=[0.13,1.29],                                         
##       EU_Sales=[0.01,0.05),                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.24,1.94]}                                  7  
## [3]  {Rank=[879,6.89e+03),                                          
##       Name=NHL 2K10,                                                
##       Platform=PS2,                                                 
##       Year=2009,                                                    
##       Genre=Sports,                                                 
##       Publisher=Take-Two Interactive,                               
##       NA_Sales=[0.13,1.29],                                         
##       EU_Sales=[0.05,1.26],                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0.02,0.34],                                      
##       Global_Sales=[0.24,1.94]}                                  8  
## [4]  {Rank=[6.89e+03,1.19e+04),                                     
##       Name=Championship Foosball,                                   
##       Platform=Wii,                                                 
##       Year=2008,                                                    
##       Genre=Sports,                                                 
##       Publisher=505 Games,                                          
##       NA_Sales=[0.01,0.13),                                         
##       EU_Sales=[0,0.01),                                            
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.07,0.24)}                                  14 
## [5]  {Rank=[1.19e+04,1.64e+04],                                     
##       Name=ESPN Winter X Games: Snowboarding 2002,                  
##       Platform=XB,                                                  
##       Year=2002,                                                    
##       Genre=Sports,                                                 
##       Publisher=Konami Digital Entertainment,                       
##       NA_Sales=[0.01,0.13),                                         
##       EU_Sales=[0.01,0.05),                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.01,0.07)}                                  22 
## [6]  {Rank=[879,6.89e+03),                                          
##       Name=FIFA Soccer 09,                                          
##       Platform=X360,                                                
##       Year=2008,                                                    
##       Genre=Sports,                                                 
##       Publisher=Electronic Arts,                                    
##       NA_Sales=[0.13,1.29],                                         
##       EU_Sales=[0.05,1.26],                                         
##       JP_Sales=[0.01,0.74],                                         
##       Other_Sales=[0.02,0.34],                                      
##       Global_Sales=[0.24,1.94]}                                  38 
## [7]  {Rank=[1.19e+04,1.64e+04],                                     
##       Name=Bode Miller Alpine Skiing,                               
##       Platform=PS2,                                                 
##       Year=2006,                                                    
##       Genre=Sports,                                                 
##       Publisher=Valcon Games,                                       
##       NA_Sales=[0.01,0.13),                                         
##       EU_Sales=[0.01,0.05),                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.01,0.07)}                                  40 
## [8]  {Rank=[879,6.89e+03),                                          
##       Name=Madden NFL 98,                                           
##       Platform=PS,                                                  
##       Year=1997,                                                    
##       Genre=Sports,                                                 
##       Publisher=Electronic Arts,                                    
##       NA_Sales=[0.13,1.29],                                         
##       EU_Sales=[0.01,0.05),                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0.02,0.34],                                      
##       Global_Sales=[0.24,1.94]}                                  41 
## [9]  {Rank=[6.89e+03,1.19e+04),                                     
##       Name=Derby Stallion,                                          
##       Platform=SAT,                                                 
##       Year=1999,                                                    
##       Genre=Sports,                                                 
##       Publisher=ASCII Entertainment,                                
##       NA_Sales=[0,0.01),                                            
##       EU_Sales=[0,0.01),                                            
##       JP_Sales=[0.01,0.74],                                         
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.07,0.24)}                                  45 
## [10] {Rank=[6.89e+03,1.19e+04),                                     
##       Name=My Fitness Coach 2: Exercise and Nutrition,              
##       Platform=Wii,                                                 
##       Year=2009,                                                    
##       Genre=Sports,                                                 
##       Publisher=Black Bean Games,                                   
##       NA_Sales=[0.13,1.29],                                         
##       EU_Sales=[0.01,0.05),                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0.02,0.34],                                      
##       Global_Sales=[0.07,0.24)}                                  64 
## [11] {Rank=[879,6.89e+03),                                          
##       Name=Athens 2004,                                             
##       Platform=PS2,                                                 
##       Year=2004,                                                    
##       Genre=Sports,                                                 
##       Publisher=Sony Computer Entertainment,                        
##       NA_Sales=[0.13,1.29],                                         
##       EU_Sales=[0.05,1.26],                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0.02,0.34],                                      
##       Global_Sales=[0.24,1.94]}                                  69 
## [12] {Rank=[6.89e+03,1.19e+04),                                     
##       Name=Sega Soccer Slam,                                        
##       Platform=PS2,                                                 
##       Year=2002,                                                    
##       Genre=Sports,                                                 
##       Publisher=Sega,                                               
##       NA_Sales=[0.01,0.13),                                         
##       EU_Sales=[0.05,1.26],                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0.02,0.34],                                      
##       Global_Sales=[0.07,0.24)}                                  75 
## [13] {Rank=[6.89e+03,1.19e+04),                                     
##       Name=Atsumare! Power Pro Kun no DS Koushien,                  
##       Platform=DS,                                                  
##       Year=N/A,                                                     
##       Genre=Sports,                                                 
##       Publisher=N/A,                                                
##       NA_Sales=[0,0.01),                                            
##       EU_Sales=[0,0.01),                                            
##       JP_Sales=[0.01,0.74],                                         
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.07,0.24)}                                  77 
## [14] {Rank=[879,6.89e+03),                                          
##       Name=MLB,                                                     
##       Platform=PSP,                                                 
##       Year=2005,                                                    
##       Genre=Sports,                                                 
##       Publisher=Sony Computer Entertainment,                        
##       NA_Sales=[0.13,1.29],                                         
##       EU_Sales=[0,0.01),                                            
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0.02,0.34],                                      
##       Global_Sales=[0.24,1.94]}                                  78 
## [15] {Rank=[1.19e+04,1.64e+04],                                     
##       Name=NHL Hitz Pro,                                            
##       Platform=XB,                                                  
##       Year=2003,                                                    
##       Genre=Sports,                                                 
##       Publisher=Midway Games,                                       
##       NA_Sales=[0.01,0.13),                                         
##       EU_Sales=[0.01,0.05),                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.07,0.24)}                                  90 
## [16] {Rank=[879,6.89e+03),                                          
##       Name=Mario Tennis,                                            
##       Platform=GB,                                                  
##       Year=2000,                                                    
##       Genre=Sports,                                                 
##       Publisher=Nintendo,                                           
##       NA_Sales=[0.13,1.29],                                         
##       EU_Sales=[0.05,1.26],                                         
##       JP_Sales=[0.01,0.74],                                         
##       Other_Sales=[0.02,0.34],                                      
##       Global_Sales=[0.24,1.94]}                                  94 
## [17] {Rank=[6.89e+03,1.19e+04),                                     
##       Name=International Soccer,                                    
##       Platform=2600,                                                
##       Year=1981,                                                    
##       Genre=Sports,                                                 
##       Publisher=Mattel Interactive,                                 
##       NA_Sales=[0.13,1.29],                                         
##       EU_Sales=[0.01,0.05),                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.07,0.24)}                                  105
## [18] {Rank=[6.89e+03,1.19e+04),                                     
##       Name=FIFA World Cup Germany 2006,                             
##       Platform=GC,                                                  
##       Year=2006,                                                    
##       Genre=Sports,                                                 
##       Publisher=Electronic Arts,                                    
##       NA_Sales=[0.01,0.13),                                         
##       EU_Sales=[0.01,0.05),                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.07,0.24)}                                  106
## [19] {Rank=[1.19e+04,1.64e+04],                                     
##       Name=Pro Yaky? Spirits 2014,                                  
##       Platform=PSV,                                                 
##       Year=2014,                                                    
##       Genre=Sports,                                                 
##       Publisher=Konami Digital Entertainment,                       
##       NA_Sales=[0,0.01),                                            
##       EU_Sales=[0,0.01),                                            
##       JP_Sales=[0.01,0.74],                                         
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.07,0.24)}                                  116
## [20] {Rank=[6.89e+03,1.19e+04),                                     
##       Name=Jillian Michaels Fitness Ultimatum 2010,                 
##       Platform=DS,                                                  
##       Year=2009,                                                    
##       Genre=Sports,                                                 
##       Publisher=Majesco Entertainment,                              
##       NA_Sales=[0.01,0.13),                                         
##       EU_Sales=[0,0.01),                                            
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.07,0.24)}                                  119
## [21] {Rank=[6.89e+03,1.19e+04),                                     
##       Name=Jikkyou Powerful Pro Yakyuu Next,                        
##       Platform=Wii,                                                 
##       Year=2009,                                                    
##       Genre=Sports,                                                 
##       Publisher=Konami Digital Entertainment,                       
##       NA_Sales=[0,0.01),                                            
##       EU_Sales=[0,0.01),                                            
##       JP_Sales=[0.01,0.74],                                         
##       Other_Sales=[0,0.02),                                         
##       Global_Sales=[0.07,0.24)}                                  128
## [22] {Rank=[6.89e+03,1.19e+04),                                     
##       Name=Brunswick Pro Bowling,                                   
##       Platform=PS3,                                                 
##       Year=2010,                                                    
##       Genre=Sports,                                                 
##       Publisher=505 Games,                                          
##       NA_Sales=[0.01,0.13),                                         
##       EU_Sales=[0.05,1.26],                                         
##       JP_Sales=[0,0.01),                                            
##       Other_Sales=[0.02,0.34],                                      
##       Global_Sales=[0.07,0.24)}                                  136

Now lets find some drequent item sets.

its <- apriori(trans, parameter=list(target = "frequent"))
## Apriori
## 
## Parameter specification:
##  confidence minval smax arem  aval originalSupport maxtime support minlen
##          NA    0.1    1 none FALSE            TRUE       5     0.1      1
##  maxlen            target  ext
##      10 frequent itemsets TRUE
## 
## Algorithmic control:
##  filter tree heap memopt load sort verbose
##     0.1 TRUE TRUE  FALSE TRUE    2    TRUE
## 
## Absolute minimum support count: 15 
## 
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[289 item(s), 150 transaction(s)] done [0.00s].
## sorting and recoding items ... [24 item(s)] done [0.00s].
## creating transaction tree ... done [0.00s].
## checking subsets of size 1 2 3 4 5 6 done [0.00s].
## sorting transactions ... done [0.00s].
## writing ... [237 set(s)] done [0.00s].
## creating S4 object  ... done [0.00s].
its
## set of 237 itemsets
inspect(head(its, n = 10))
##      items                      support   transIdenticalToItemsets count
## [1]  {Year=2008}                0.1000000 0                        15   
## [2]  {Platform=DS}              0.1000000 0                        15   
## [3]  {Genre=Adventure}          0.1066667 0                        16   
## [4]  {Platform=Wii}             0.1066667 0                        16   
## [5]  {Genre=Role-Playing}       0.1133333 0                        17   
## [6]  {Platform=PS2}             0.1400000 0                        21   
## [7]  {Genre=Sports}             0.1466667 0                        22   
## [8]  {Genre=Action}             0.2466667 0                        37   
## [9]  {Global_Sales=[0.01,0.07)} 0.2800000 0                        42   
## [10] {EU_Sales=[0,0.01)}        0.3133333 0                        47
ggplot(tibble(`Itemset Size` = factor(size(its))), aes(`Itemset Size`)) + geom_bar()

From the graph, we can see that most of the item set have the size of 3.

Now lets build some rules.

rules <- apriori(trans, parameter = list(support = 0.05, confidence = 0.9))
## Apriori
## 
## Parameter specification:
##  confidence minval smax arem  aval originalSupport maxtime support minlen
##         0.9    0.1    1 none FALSE            TRUE       5    0.05      1
##  maxlen target  ext
##      10  rules TRUE
## 
## Algorithmic control:
##  filter tree heap memopt load sort verbose
##     0.1 TRUE TRUE  FALSE TRUE    2    TRUE
## 
## Absolute minimum support count: 7 
## 
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[289 item(s), 150 transaction(s)] done [0.00s].
## sorting and recoding items ... [44 item(s)] done [0.00s].
## creating transaction tree ... done [0.00s].
## checking subsets of size 1 2 3 4 5 6 7 done [0.00s].
## writing ... [706 rule(s)] done [0.00s].
## creating S4 object  ... done [0.00s].
inspect(head(rules))
##     lhs                 rhs                    support    confidence coverage  
## [1] {Year=2015}      => {EU_Sales=[0.01,0.05)} 0.05333333 1.0000000  0.05333333
## [2] {Year=2015}      => {Other_Sales=[0,0.02)} 0.05333333 1.0000000  0.05333333
## [3] {Genre=Strategy} => {Other_Sales=[0,0.02)} 0.06000000 1.0000000  0.06000000
## [4] {Platform=PC}    => {Other_Sales=[0,0.02)} 0.06000000 0.9000000  0.06666667
## [5] {Platform=PC}    => {JP_Sales=[0,0.01)}    0.06666667 1.0000000  0.06666667
## [6] {Year=2005}      => {JP_Sales=[0,0.01)}    0.06666667 0.9090909  0.07333333
##     lift     count
## [1] 2.941176  8   
## [2] 1.530612  8   
## [3] 1.530612  9   
## [4] 1.377551  9   
## [5] 1.515152 10   
## [6] 1.377410 10
plot(rules,jitter = 1)

The graph shows the data that are positively correlated which has lift higher than 1. According to the graph, the darkest ones has the higher lift and the lift less than one is negative correlated so they are faded in the background.

plot(rules, shading = "order")
## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter.

Order is how many items were in the rule.That is items implying other items.

plot(head(rules, n = 100), method = "graph")

From the data, it looks like EU_Sales and the Other_Sales have the highest support.