Learn R Programming

arules (version 1.3-0)

abbreviate: Abbreviate function for item labels in transactions, itemMatrix and associations

Description

Methods to abbreviate long item labels in transactions, associations (rules and itemsets) and transaction ID lists. Note that abbreviate is not a generic and this arules defines a generic with the R's abbreviate as the default.

Usage

abbreviate(...)
## S3 method for class 'transactions':
abbreviate(data, minlength = 4, ..., method = "both.sides")
## S3 method for class 'rules':
abbreviate(data, minlength = 4, ..., method = "both.sides")
## S3 method for class 'itemsets':
abbreviate(data, minlength = 4, ..., method = "both.sides")
## S3 method for class 'itemMatrix':
abbreviate(data, minlength = 4, ..., method = "both.sides")
## S3 method for class 'tidLists':
abbreviate(data, minlength = 4, ..., method = "both.sides")

Arguments

data
an object of class "transactions", "itemMatrix", "itemsets", "rules" or "tidLists".
minlength
number of characters allowed in abbreviation
method
apply to level and value (both.sides)
...
further arguments passed on to the default abbreviation function.

See Also

abbreviate in base.

Examples

Run this code
data(Adult)
inspect(head(Adult, 1))

Adult_abbr <- abbreviate(Adult, 15)
inspect(head(Adult_abbr, 1))

Run the code above in your browser using DataLab