Learn R Programming

arules (version 1.7-6)

extract: Methods for "[": Extraction or Subsetting arules Objects

Description

Methods for "[", i.e., extraction or subsetting for arules objects.

Usage

# S4 method for itemMatrix,ANY,ANY,ANY
[(x, i, j, ..., drop = TRUE)

# S4 method for transactions,ANY,ANY,ANY [(x, i, j, ..., drop = TRUE)

# S4 method for tidLists,ANY,ANY,ANY [(x, i, j, ..., drop = TRUE)

# S4 method for rules,ANY,ANY,ANY [(x, i, j, ..., drop = TRUE)

# S4 method for itemsets,ANY,ANY,ANY [(x, i, j, ..., drop = TRUE)

Arguments

x

an object of class itemMatrix, transactions or associations.

i

select rows/sets using an integer vector containing row numbers or a logical vector.

j

select columns/items using an integer vector containing column numbers (i.e., item IDs), a logical vector or a vector of strings containing parts of item labels.

...

further arguments are ignored.

drop

ignored.

Author

Michael Hahsler

See Also

Other associations functions: abbreviate(), associations-class, c(), duplicated(), inspect(), 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(), crossTable(), c(), duplicated(), hierarchy, image(), inspect(), is.superset(), itemFrequencyPlot(), itemFrequency(), itemMatrix-class, match(), merge(), random.transactions(), sample(), sets, size(), supportingTransactions(), tidLists-class, transactions-class, unique()

Examples

Run this code
data(Adult)
Adult

## select first 10 transactions
Adult[1:10]

## select first 10 items for first 100 transactions
Adult[1:100, 1:10]

## select the first 100 transactions for the items containing
## "income" or "age=Young" in their labels
Adult[1:100, c("income=small", "income=large" ,"age=Young")]

Run the code above in your browser using DataLab