R/fct_graph_helpers.R
graph_to_R_code.Rd
Takes in a graph dataframe, returns the graph formatted as R code
graph_to_R_code(graph)
A graph df, like that returned by gfpop::graph()
a string corresponding to the code that, when run, produces the given graph
graph <- gfpop::graph(type = "std")
graph_to_R_code(graph)
#> [1] "gfpop::graph(\n gfpop::Edge(state1 = 'Std', state2 = 'Std', type = 'null', gap = 1, penalty = 0, K = Inf, a = 0),\n gfpop::Edge(state1 = 'Std', state2 = 'Std', type = 'std', gap = 0, penalty = 0, K = Inf, a = 0)\n)"