I'm doing some in-line calculations in R Markdown. Just wondering how to retrieve summary elements of transactional data? Here is the code I have so far:
## Libraries
library(arules)
## Data
data("Adult")
## Other summaries
length(Adult) # no. transactions
dim(itemInfo(Adult))[[1]] # no. distinct items
What I'm trying to get is the density of the itemset. These are the things I have tried:
str(summary(Adult))
summary(Adult)$density
summary(Adult)[["density"]]
Adult$density
This is the error I keep getting:
object of type 'S4' is not subsettable
Thanks in advance for any help you might be able to give.