library(tricky)
library(tibble)

Suppose we have a dataset with for each row the name of a node and the name of a group it belongs to. We want to have a dataset with all relationships between nodes (ie if A and B belong to the group a, they have one relationship.)

toy_data <- tibble::tibble(
  node = c("A", "B", "C", "A", "B"),
  link = c("a", "a", "b", "b", "b")
  )
toy_data
library(tricky)
make_single_node_node_table_(
  .data = toy_data,
  .id = "A", 
  node = "node",
  link = "link"
  )
library(tricky)
make_node_node_table_(
  .data = toy_data,
  node = "node",
  link = "link"
  )


blaquans/tricky documentation built on May 12, 2019, 9:29 p.m.