Sample using a gamma distribution
sample_gamma.RdSample from a gamma distribution using the expected value in x and the
standard deviation in sd. The gamma shape and scale parameters are
derived from the input mean and standard deviation.
Arguments
- x
A numeric vector of observations to sample from. If a single value is provided, it will be recycled to the length of
sd. Otherwise, it must be the same length assd.- sd
A numeric vector of standard deviations to use in
rgamma(). If a single value is provided, it will be recycled to the length ofx. Otherwise, it must be the same length asx.