Provides the generic function inspect
and S4 methods to display
associations and transactions plus additional information formatted for
online inspection.
inspect(x, ...)
a set of associations or transactions or an itemMatrix.
additional arguments can be used to customize the
output: setStart
, setEnd
, itemSep
and ruleSep
.
Items are printed only one per line in case the output lines get very long.
This can also be directly controlled using linebreak
.
Nothing is returned. This function is purely used for displaying object details. Use coercion with
as
to a list or a data.frame or the accessor functions provided for the object (see See Also section).
itemMatrix-class
,
itemsets-class
,
rules-class
,
transactions-class
,
DATAFRAME
# NOT RUN {
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