Learn R Programming

arules (version 1.7-9)

inspect: Display Associations and Transactions in Readable Form

Description

Provides the generic function inspect() and methods to display associations and transactions plus additional information formatted for online inspection.

Usage

inspect(x, ...)

# S4 method for itemsets inspect(x, itemSep = ", ", setStart = "{", setEnd = "}", linebreak = NULL, ...)

# S4 method for rules inspect( x, itemSep = ", ", setStart = "{", setEnd = "}", ruleSep = "=>", linebreak = NULL, ... )

# S4 method for transactions inspect(x, itemSep = ", ", setStart = "{", setEnd = "}", linebreak = NULL, ...)

# S4 method for itemMatrix inspect(x, itemSep = ", ", setStart = "{", setEnd = "}", linebreak = NULL, ...)

# S4 method for tidLists inspect(x, ...)

Value

Nothing is returned (see the Details Section).

Arguments

x

a set of associations or transactions or an itemMatrix.

...

additional arguments. can be used to customize the output:

itemSep

item separator

setStart

set start symbol

setEnd

set end symbol

linebreak

print only one element per line in case the output lines get very long?

ruleSep

rule separator

Author

Michael Hahsler and Kurt Hornik

Details

inspect() prints the results directly. If you need to create a data.frame with a human readable version, then you can use DATAFRAME().

See Also

Other associations functions: abbreviate(), associations-class, c(), duplicated(), extract, is.closed(), is.generator(), is.maximal(), is.redundant(), is.significant(), is.superset(), itemsets-class, match(), rules-class, sample(), sets, size(), sort(), unique()

Other itemMatrix and transactions functions: abbreviate(), c(), crossTable(), duplicated(), extract, hierarchy, image(), is.superset(), itemFrequency(), itemFrequencyPlot(), itemMatrix-class, match(), merge(), random.transactions(), sample(), sets, size(), supportingTransactions(), tidLists-class, transactions-class, unique()

Examples

Run this code
data("Adult")
rules <- apriori(Adult)

## display some rules
inspect(rules[1000:1001])
inspect(rules[1000:1001],
  ruleSep = "~~>", itemSep = " + ", setStart = "", setEnd = "",
  linebreak = FALSE
)

## to get rules in readable format, use coercion or DATAFRAME with additional parameters.
as(rules[1000:1001], "data.frame")
DATAFRAME(rules[1000:1001])
DATAFRAME(rules[1000:1001], separate = TRUE, setStart = "", setEnd = "")

Run the code above in your browser using DataLab