syn_pop {ibmcraftr}R Documentation

Create a synthetic population having several states.

Description

Populate a matrix in which columns represent the states of the individuals and rows represent the individuals.

Usage

syn_pop(states, shuffle = FALSE)

Arguments

states

A numeric vector with each element representing the number of individuals in a particular state its index corresponds to.

shuffle

A logical value to enable shuffling of the individuals (rows) in the resulting matrix.

Value

A matrix of 0s, and 1s. The rows representing the individuals and the columns representing the states the individuals are in

Examples

syn_pop(c(3,2,1))
syn_pop(c(0,0,1,5), shuffle=TRUE)


[Package ibmcraftr version 1.0.0 Index]