read.transactions {arules} | R Documentation |
Reads a transaction data file from disk and creates a
transactions
object.
read.transactions(file, format = c("basket", "single"), sep = NULL, cols = NULL)
file |
the file name. |
format |
a character string indicating the format of the data
set. One of "basket" or "single" , can be
abbreviated. |
sep |
a character string specifying how fields are separated in
the data file, or NULL (default). For basket format, this
can be a regular expression; otherwise, a single character must be
given. The default corresponds to white space separators. |
cols |
an numeric vector of length two giving the numbers of the columns (fields) with the transaction and item ids, respectively. Only used for ‘single’ format. |
For ‘basket’ format, each line in the transaction data file
represents a transaction where the items (item labels) are separated
by the characters specified by sep
. For ‘single’
format, each line corresponds to a single item, containing at least
ids for the transaction and the item.
Returns an object of class
transactions
.
Michael Hahsler