merge

0th

Percentile

Adding Items to Data

Provides the generic function merge and the S4 methods for itemMatrix and transactions. The methods are used to add new items to existing data.

Keywords
manip
Usage
merge(x, y, ...)
Arguments
x

an object of class itemMatrix or transactions.

y

an object of the same class as x (or something which can be coerced to that class).

...

further arguments; unused.

Value

Returns a new object of the same class as x with the items in y added.

See Also

transactions-class, itemMatrix-class, addComplement

Aliases
  • merge
  • merge,itemMatrix-method
  • merge,transactions-method
Examples
# NOT RUN {
data("Groceries")

## create a random item as a matrix
randomItem <- sample(c(TRUE, FALSE), size=length(Groceries),replace=TRUE)
randomItem <- as.matrix(randomItem)
colnames(randomItem) <- "random item"
head(randomItem, 3)

## add the random item to Groceries
g2 <- merge(Groceries, randomItem)
nitems(Groceries)
nitems(g2)
inspect(head(g2,3))
# }
Documentation reproduced from package arules, version 1.5-4, License: GPL-3

Community examples

Looks like there are no examples yet.