read_transactions
reads transaction data from a file fast, providing a
significant speed increase over alternative methods for larger files.
read_transactions(filename, sep = " ", format = "list")
A filename.
The separator between items (default " ").
The output format ("list" or "transactions").
The transaction data, in the form of a list (of transactions, each
list element being a vector of character values representing item labels), or
an object of class transactions
(arules
).
read_transactions
uses (internally) the readChar
function to read transaction data from a file fast. This is substantially
faster for larger files than alternative methods.
Files should be in the format of a list of transactions, one line per
transaction, each transaction (ie, line) being a sequence of item labels,
separated by the character specified by the parameter sep
(default "
"). See, for example, the files at http://fimi.ua.ac.be/data/.
# NOT RUN {
trans <- read_transactions("mushroom.dat")
trans <- read_transactions("mushroom.dat", format = "transactions")
# }
Run the code above in your browser using DataLab