data("Epub")
## write the formated result to screen
WRITE(head(Epub))
## write the formated result to file in CSV format
WRITE(Epub, file = "data.csv", 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", sep = ",", col.names = NA)
unlink("data.csv") # tidy up
## write rules as PMML
library(pmml)
rules_pmml <- pmml(rules)
saveXML(rules_pmml, "data.xml")
unlink("data.xml") # tidy upRun the code above in your browser using DataLab