remove_inner_relations: Remove all inner relations in a network

Description Usage Arguments Details Value Examples

View source: R/remove_inner_relations.R

Description

remove_inner_relations() removes all inner relations in a network - see examples for more...

Usage

1

Arguments

graph_dt

data.table; A data.table with a "from", a "to" and a "level" column. See details for more.

Details

The function takes as its input a graph_dt from either get_parents() or get_children() with at least three columns called "from", "to" and "level" potentially many more.

Value

It will return the inputted graph_dt data.table but with all inner relations removed. See examples.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
my_network <- data.table::data.table(
  from = c("A", "B", "B", "C", "C", "E"),
  to = c("B", "C", "D", "E", "B", "A")
)

# -------------------------------
my_children <- get_children(my_network, "A")

remove_inner_relations(my_children)


# -------------------------------
my_parents <- get_parents(my_network, "E")

remove_inner_relations(my_parents)

emillykkejensen/familyR documentation built on May 4, 2019, 3:12 a.m.