Description Usage Arguments Value Examples
boot_vector
returns n
samples of boostraped vector of
raw counts or proportions. If raw counts (integers) are supplied in x
,
a multinomial sample is drawn with sum(x)
trials with weights
equal x
. If x
does not contain integers, a Dirichlet sample
with parameter x
. If depth
is supplied, the samples
are scaled to have sum equal to depth
.
1 2 | boot_vector(x, n = 1, depth = NULL, replace_zeros = FALSE,
replace_value = 1)
|
x |
(Required). A vector of counts. |
n |
(Optional). Default 1. An integer indicating the number of boostrap count vectors to return. |
replace_value |
(Optional) The value to replace zeros with, when replace_zero is TRUE; i.e. we add a small positive weight. Default value is 1. |
replace_zero |
(Optional) A logical specifying whether to replace zeros in x. |
A vector or a matrix of n
vectors boostrapped from x
.
1 2 3 4 5 6 7 8 9 | boot_vector(sample(1:1000, 5))
x <- sample(1:1000, 10)
x[sample(1:length(x), 4)] <- 0
boot_vector(x, n = 3, replace_zero = TRUE)
y <- runif(10)
y <- y/sum(y)
boot_vector(y, n = 4, replace_zero = 0.05)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.