sample

0th

Percentile

Random Samples and Permutations

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.

Keywords
manip
Usage
sample(x, size, replace = FALSE, prob = NULL, ...)
Arguments
x

object to be sampled from (a set of associations or transactions).

size

sample size.

replace

a logical. Sample with replacement?

prob

a numeric vector of probability weights.

...

further arguments.

Value

An object of the same class as x.

See Also

associations-class, transactions-class, itemMatrix-class.

Aliases
  • sample
  • sample,itemMatrix-method
  • sample,associations-method
Examples
# NOT RUN {
data("Adult")

## sample with replacement
s <- sample(Adult, 500, replace = TRUE)
s
# }
Documentation reproduced from package arules, version 1.5-4, License: GPL-3

Community examples

Looks like there are no examples yet.