knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

hhsim

The goal of hhsim is to simulate household dynamics by allowing individuals to appear, change households or disappear from the observed population.

Installation

You can install the development version of hhsim from GitHub with:

# install.packages("devtools")
devtools::install_github("Jean-Rubin/hhsim")

Example

This is a basic example which shows you how to solve a common problem:

library(hhsim)
## basic example code

hh_gen <- hh_geometric(2L)
population_init <- generate_population(n = 10L, hh_gen = hh_gen)
population_init |>
  introduce(n = 5L, hh_gen = hh_gen) |>
  evolve(prop = 0.2) |>
  remove(n = 5L)


Jean-Rubin/hhsim documentation built on April 27, 2022, 12:03 a.m.