Description Usage Arguments Details Value See Also Examples
Compute incremental random samples from a type frequency list (an
object of class tfl).
1 | sample.tfl(obj, N, force.list=FALSE)
|
obj |
an object of class |
N |
a vector of non-negative integers in increasing order, the sample sizes for which incremental samples will be generated |
force.list |
if |
The current implementation is reasonably efficient, but will be rather slow when applied to very large type frequency lists.
If N is a single integer (and the force.list flag is not
set), a tfl object representing a random sample of size N
from the type frequency list obj.
If N is a vector of length greater one, or if
force.list=TRUE, a list of tfl objects representing
incremental random samples of the specified sizes N.
Incremental means that each sample is a superset of the
preceding sample.
tfl for more information about type frequency lists
sample.spc is an analogous function for frequency
spectra (objects of class spc)
1 2 3 4 5 6 7 8 9 10 11 | ## load Brown tfl
data(Brown.tfl)
summary(Brown.tfl)
## sample a tfl of 100k tokens
MiniBrown.tfl <- sample.tfl(Brown.tfl,1e+5)
summary(MiniBrown.tfl)
## if we repat, we get a different sample
MiniBrown.tfl <- sample.tfl(Brown.tfl,1e+5)
summary(MiniBrown.tfl)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.