Deprecated function framework for randomly sampling from a corpus or dfm object. Use corpus_sample or dfm_sample instead

sample(x, size, replace = FALSE, prob = NULL, ...)

# S3 method for default
sample(x, size, replace = FALSE, prob = NULL, ...)

# S3 method for corpus
sample(x, ...)

# S3 method for dfm
sample(x, ...)

Arguments

x

a corpus or dfm object whose documents or features will be sampled

size

a positive number, the number of documents to select

replace

Should sampling be with replacement?

prob

A vector of probability weights for obtaining the elements of the vector being sampled.

...

unused

See also

corpus_sample, dfm_sample