In this section, we will continue with another supermarket example and analyze associations in the Groceries
dataset. In order to use this dataset and to explore association rules in R, we need to install and load the arules
package:
install.packages("arules") library(arules) data(Groceries)
We can now explore relationships between purchased products in this dataset. This dataset is already in a form exploitable by apriori
(transactions). We will first use the default parameters as follows:
rules = apriori(Groceries)
The output is provided in the following screenshot:
We can see on the first line the parameters used in the analysis—in this case, the default. Around the middle of the output (where the arrow is), we see that there are 169
items in 9835
transactions in this dataset, and that 0
rules have been found (see second to last line). If you try this with your own...