Learn R Programming

opusminer (version 0.1-1)

read_transactions: Read Transaction Data from a File (Fast)

Description

read_transactions reads transaction data from a file fast, providing a significant speed increase over alternative methods for larger files.

Usage

read_transactions(filename, sep = " ", format = "list")

Arguments

filename

A filename.

sep

The separator between items (default " ").

format

The output format ("list" or "transactions").

Value

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).

Details

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/.

Examples

Run this code
# NOT RUN {
trans <- read_transactions("mushroom.dat")
trans <- read_transactions("mushroom.dat", format = "transactions")
# }

Run the code above in your browser using DataLab