powered by
Provides the generic function sample and the S4 method to take a sample of the specified size from the elements of x using either with or without replacement. sample can be used to sample from a set of transactions or associations.
sample
x
sample(x, size, replace = FALSE, prob = NULL, ...)
object to be sampled from (a set of associations or transactions).
associations
transactions
sample size.
a logical. Sample with replacement?
a numeric vector of probability weights.
further arguments.
An object of the same class as x.
associations-class, transactions-class, itemMatrix-class.
associations-class
transactions-class
itemMatrix-class
# NOT RUN { data("Adult") ## sample with replacement s <- sample(Adult, 500, replace = TRUE) s # }
Run the code above in your browser using DataLab