Given an organisation tbl_graph object with the unit_size column defined, a tibble will be generated with one row per individual in the organisation. For test purposes a dummy variable is also generated.

simulate_individuals_df(x)

Arguments

x

tbl_graph organisation with unit_size defined

Value

tibble

Examples

set.seed(1234) tg_ex1 <- create_realistic_org(n_children = 4, max_depth = 3, prob=0.3) tg_ex1 <- simulate_unit_size(tg_ex1) df <- simulate_individuals_df(tg_ex1) df
#> # A tibble: 146 x 4 #> individual_id individual_name unit_id test_var #> <chr> <chr> <chr> <dbl> #> 1 1 1_1 1 8.64 #> 2 2 1_2 1 10.6 #> 3 3 1_3 1 9.45 #> 4 4 2_1 2 12.1 #> 5 5 2_2 2 10.5 #> 6 6 3_1 3 8.45 #> 7 7 4_1 4 8.80 #> 8 8 6_1 6 5.70 #> 9 9 6_2 6 3.97 #> 10 10 6_3 6 11.0 #> # ... with 136 more rows