Takes in a graph dataframe, returns the graph formatted as R code

graph_to_R_code(graph)

Arguments

graph

A graph df, like that returned by gfpop::graph()

Value

a string corresponding to the code that, when run, produces the given graph

Examples

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)"