graphdf_to_visNetwork: Turns a graph dataframe (from gfpop) into a list that can be...

View source: R/fct_visNetwork_helpers.R

graphdf_to_visNetworkR Documentation

Turns a graph dataframe (from gfpop) into a list that can be read by visNetwork

Description

Turns a graph dataframe (from gfpop) into a list that can be read by visNetwork

Usage

graphdf_to_visNetwork(
  graphdf,
  edgeSep = "_",
  showNull = TRUE,
  label_columns = c("type", "penalty"),
  label_collapse = " | ",
  edge_ids = c()
)

Arguments

graphdf

A graph object (in the form of a dataframe) from gfpop Must have the following columns:

  • "state1"

  • "state2"

  • "type"

  • "parameter"

  • "penalty"

  • "K"

  • "a"

  • "min"

  • "max"

edgeSep

A character seperating the nodes in an edge label

showNull

(Boolean) hide null edges?

label_columns

(character) An array of columns to use to make edge labels

label_collapse

the character separating edge columns in this label

edge_ids

An array of ids, one for each edge in the graphdf

Value

a list that can be read by visNetwork

Examples

graphdf_to_visNetwork(gfpop::graph(type = "std"), edge_ids = 1:2)

julianstanley/gfpopgui documentation built on April 16, 2022, 2:58 a.m.