
Last chance! 50% off unlimited learning
Sale ends in
Provides the generic function sample()
and methods to sample from transactions and
associations.
# S4 method for itemMatrix
sample(x, size, replace = FALSE, prob = NULL, ...)# S4 method for associations
sample(x, size, replace = FALSE, prob = NULL, ...)
An object of the same class as x
.
object to be sampled from (a set of associations or transactions).
sample size.
a logical. Sample with replacement?
a numeric vector of probability weights.
further arguments.
Michael Hahsler
Other preprocessing:
discretize()
,
hierarchy
,
itemCoding
,
merge()
Other associations functions:
abbreviate()
,
associations-class
,
c()
,
duplicated()
,
extract
,
inspect()
,
is.closed()
,
is.generator()
,
is.maximal()
,
is.redundant()
,
is.significant()
,
is.superset()
,
itemsets-class
,
match()
,
rules-class
,
sets
,
size()
,
sort()
,
unique()
Other itemMatrix and transactions functions:
abbreviate()
,
crossTable()
,
c()
,
duplicated()
,
extract
,
hierarchy
,
image()
,
inspect()
,
is.superset()
,
itemFrequencyPlot()
,
itemFrequency()
,
itemMatrix-class
,
match()
,
merge()
,
random.transactions()
,
sets
,
size()
,
supportingTransactions()
,
tidLists-class
,
transactions-class
,
unique()
data("Adult")
## sample with replacement
s <- sample(Adult, 500, replace = TRUE)
s
Run the code above in your browser using DataLab