read_transactions: Read Transaction Data from a File (Fast)

Description Usage Arguments Details Value Examples

View source: R/opusminer.R

Description

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

Usage

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

Arguments

filename

A filename.

sep

The separator between items (default " ").

format

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

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

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

Examples

1
2
3
4
5
6
## Not run: 

trans <- read_transactions("mushroom.dat")
trans <- read_transactions("mushroom.dat", format = "transactions")

## End(Not run)

Example output

invalid filename
invalid filename

opusminer documentation built on Feb. 4, 2020, 9:08 a.m.