resample: Adapted directly from the 'base::sample()' help file.

View source: R/resample.R

resampleR Documentation

Adapted directly from the base::sample() help file.

Description

Adapted directly from the base::sample() help file.

resampleZeroProof is a version that works even if sum of all probabilities passed to sample.int is zero. This causes an error in sample.int.

Usage

resample(x, ...)

resampleZeroProof(spreadProbHas0, x, n, prob)

Arguments

x

either a vector of one or more elements from which to choose, or a positive integer. See ‘Details.’

...

Passed to base::sample()

spreadProbHas0

logical. Does spreadProb have any zeros on it.

n

a positive number, the number of items to choose from. See ‘Details.’

prob

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

Note

Intended for internal use only.


PredictiveEcology/SpaDES.tools documentation built on April 18, 2024, 3:21 a.m.