This function builds on
sample to provide sampling from a vector, but with all
zero entries fixed. This way,
zfsample(c(0,1,0,2)) may result in (0,1,0,2) or (0,2,0,1), but the
positions that were initially zero will remain zeroed.
Either a vector of one or more elements from which to choose, or a positive integer.
Should sampling be with replacement?
a vector of the same length of 'x' with elements drawn from 'x'.
The actual sampling is done by
sample, so its help page should be checked
for details on the parameter handling. The parameter 'size' is always passed as
and 'prob' is not supported.
1 2 3 4 5 6 7 8