check_tbl_graph_is_org: Check tbl_graph is an organisation

Description Usage Arguments Examples

Description

Verify that a tbl_graph has the right features to be an organisation

Usage

1

Arguments

x

an object to check

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(tidygraph)

set.seed(1234)
tg1 <- create_realistic_org()
check_tbl_graph_is_org(tg1)
# returns no errors

tg2 <- tidygraph::create_star(30)
## Not run: 
check_tbl_graph_is_org(tg2)
# returns an error

## End(Not run)

tg3 <- filter(tg1, unit_id != 1)
check_tbl_graph_is_org(tg3)
# returns a warning that the tree is no longer rooted

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