R/fct_visNetwork_helpers.R
graphdf_to_visNetwork.Rd
Turns a graph dataframe (from gfpop) into a list that can be read by visNetwork
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"
A character seperating the nodes in an edge label
(Boolean) hide null edges?
(character) An array of columns to use to make edge labels
the character separating edge columns in this label
An array of ids, one for each edge in the graphdf
a list that can be read by visNetwork
graphdf_to_visNetwork(gfpop::graph(type = "std"), edge_ids = 1:2)
#> $nodes
#> id label size start end shape color.background color.border shadow
#> 1: Std Std 40 FALSE FALSE dot lightblue lightblue FALSE
#>
#> $edges
#> id label to from type parameter penalty K a min max
#> 1: 1 null | 0 Std Std null 1 0 Inf 0 None None
#> 2: 2 std | 0 Std Std std 0 0 Inf 0 None None
#> selfReference.angle selfReference.size hidden color
#> 1: 3.141593 40 FALSE black
#> 2: 6.283185 40 FALSE black
#>