Learn R Programming

arules (version 1.7-8)

associations-class: Class associations --- A Set of Associations

Description

The associations class is a virtual class which is extended to represent mining result (e.g., sets of itemsets or rules). The class defines some common methods for its subclasses.

Usage

# S4 method for associations
quality(x)

# S4 method for associations quality(x) <- value

# S4 method for associations info(x)

# S4 method for associations info(x) <- value

# S4 method for associations head(x, n = 6L, by = NULL, decreasing = TRUE, ...)

# S4 method for associations tail(x, n = 6L, by = NULL, decreasing = TRUE, ...)

# S4 method for associations items(x)

# S4 method for associations length(x)

# S4 method for associations labels(object)

Arguments

x, object

the object.

value

the replacement value.

n

number of elements

by

sort by this interest measure

decreasing

sort in decreasing order?

...

further arguments.

Functions

  • quality(associations): returns the quality data.frame.

  • quality(associations) <- value: replaces the quality data.frame. The lengths of the vectors in the data.frame have to equal the number of associations in the set.

  • info(associations): returns the info list.

  • info(associations) <- value: replaces the info list.

  • head(associations): returns the first n associations.

  • tail(associations): returns the last n associations.

  • items(associations): dummy method. This method has to be implemented by all subclasses of associations and return the items which make up each association as an object of class itemMatrix.

  • length(associations): dummy method. This method has to be implemented by all subclasses of associations and return the number of elements in the association.

  • labels(associations): dummy method. This method has to be implemented by all subclasses of associations and return a vector of length(object) of labels for the elements in the association.

Slots

quality

a data.frame

info

a list

Objects from the Class

A virtual class: No objects may be created from it.

Author

Michael Hahsler

Details

The implementations of associations store itemsets (e.g., the LHS and RHS of a rule) as objects of class itemMatrix (i.e., sparse binary matrices). Quality measures (e.g., support) are stored in a data.frame accessible via method quality().

See Sections Functions and See Also to see all available methods.

Note: Associations can store multisets with duplicated elements. Duplicated elements can result from combining several sets of associations. Use unique() to remove duplicate associations.

See Also

Subclasses: rules, itemsets

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