generate_virtual_pop: Create a virtual population

Description Usage Arguments Value Examples

View source: R/generate_virtual_pop.R

Description

This function creates a population from a distribution.

Usage

1
generate_virtual_pop(N, var_name, dist, ...)

Arguments

N

The numbers of samples

var_name

the variable name that we need to create

dist

the distribution function for random variables (starts with 'r', i.e. rnorm, rpois, rexp)

...

for the dist function

Value

a tibble that stores the virtual population

Examples

1
2
generate_virtual_pop(100, "height", rnorm, 0, 1)
generate_virtual_pop(100, "n_accidents_per_hr", rpois, 2)

tguo9/samplingsimulatorr documentation built on May 5, 2020, 12:10 a.m.