Takes in a row from a graph dataframe, returns that row formatted as R code

format_edge(edge_df)

Arguments

edge_df

One row from a gfpop::graph() graph df, with column names

Value

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

Examples

graph <- gfpop::graph(type = "std")
format_edge(graph[1,])
#> [1] "gfpop::Edge(state1 = 'Std', state2 = 'Std', type = 'null', gap = 1, penalty = 0, K = Inf, a = 0)"