data("Epub")
## write the formated transactions to screen (basket format)
write(head(Epub))
## write the formated transactions to screen (single format)
write(head(Epub), format="single")
## write the formated result to file in CSV format
write(Epub, file = "data.csv", format="single", quote=TRUE,
sep = ",", col.names = NA)
## write rules in CSV format
rules <- apriori(Epub, parameter=list(support=0.0005, conf=0.8))
write(rules, file = "data.csv", quote=TRUE, sep = ",", col.names = NA)
unlink("data.csv") # tidy up
Run the code above in your browser using DataLab