simulate_unit_size: Simulate unit sizes for an organisation

Description Usage Arguments Value Examples

Description

Function which takes a tbl_graph object representing an organisation and generates a number representing the number of individuals immediately associated with each unit. This number is stored as the 'unit_size' variable in the nodes tibble of the tbl_graph object.

Usage

1

Arguments

x

a tbl_graph object representing an organisation

Value

tbl_graph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(1234)
tg_ex1 <- create_realistic_org(n_children = 4, max_depth = 3, prob=0.3)
tg_ex1 <- simulate_unit_size(tg_ex1)

## Not run: 
set.seed(1234)
create_realistic_org(n_children = 4, max_depth = 3, prob=0.3) %>%
   simulate_unit_size() %>%
   plot_org() + geom_node_text(aes(label=unit_size), color='white')

## End(Not run)

ukgovdatascience/orgsurveyr documentation built on May 4, 2019, 7:41 p.m.