View source: R/methods-ResIN.R
| as.graphsjl.ResIN | R Documentation |
Produces Graphs.jl-style edge (and optionally node) tables from a ResIN
object. Edge endpoints are mapped to integer vertex IDs (src, dst)
to align with Graphs.jl in Julia. Node and edge metadata are preserved as table
columns. The node table stores the vertex mapping and additional ResIN metadata.
## S3 method for class 'ResIN'
as.graphsjl(
x,
file = "ResIN_graphsjl.csv",
edges_only = TRUE,
dont_save_csv = FALSE,
weight_col = "weight",
...
)
x |
A |
file |
Output file name (legacy style). If |
edges_only |
Logical; if TRUE (default), only write/return edge table. |
dont_save_csv |
Logical; if FALSE (default), write CSV output. If TRUE, no files are written and the resulting table(s) are returned visibly. |
weight_col |
Preferred edge-weight column name. Defaults to |
... |
Ignored. |
If edges_only = TRUE, an edge table data.frame.
Otherwise a list with elements edges and nodes. The node table
includes integer vertex_id values and preserved node metadata.
## Not run:
data(lik_data)
res <- ResIN(lik_data, generate_ggplot = FALSE, plot_ggplot = FALSE)
# Return tables only (no files written)
jl_tbls <- as.graphsjl(res, dont_save_csv = TRUE, edges_only = FALSE)
# Default behavior writes CSV files
# as.graphsjl(res, file = "ResIN_graphsjl.csv", edges_only = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.