random_normal_factory function

Make Normal Sampling Functions

Make Normal Sampling Functions

Makes a function that samples from a normal distribution.

random_normal_factory(mean, sd)

Arguments

  • mean: mean of normal distribution from which to sample
  • sd: standard deviation of the normal distribution

Returns

a function of a single parameter n, with default value 1.

Examples

## Not run: sampler <- random_normal_factory(mean = 70, sd = 5) ## sample one sampler() ## sample another sampler() ## sample a third time sampler() ## sample another 1000 sampler(n = 1000) ## End(Not run)

Author(s)

Homer White hwhite0@georgetowncollege.edu

  • Maintainer: Homer White
  • License: GPL (>= 3)
  • Last published: 2020-06-15

Useful links