Create an organisation where each unit has a specified number of child units up until a maximum depth.

create_regular_org(n_children = 4, max_depth = 3)

Arguments

n_children

integer defining the number of children each node should have

max_depth

the maximum depth of the organisation

Value

tidygraph object

Examples

set.seed(1234) tg1a <- create_regular_org(n_children=4, max_depth=3) tg1a
#> # A tbl_graph: 85 nodes and 84 edges #> # #> # A rooted tree #> # #> # Node Data: 85 x 0 (active) #> # #> # Edge Data: 84 x 2 #> from to #> <int> <int> #> 1 1 2 #> 2 1 3 #> 3 1 4 #> # ... with 81 more rows
# NOT RUN { plot_org(tg1a, fill_var=NULL) # }