View source: R/methods-ResIN.R
| as.networkx.ResIN | R Documentation |
Produces NetworkX-ready edge (and optionally node) tables
from a ResIN object for further manipulation in Python.
By default, this method writes CSV files that can be imported into Python
via pandas and networkx. Node and edge metadata are preserved as
table columns.
## S3 method for class 'ResIN'
as.networkx(
x,
file = "ResIN_networkx.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.
## Not run:
data(lik_data)
res <- ResIN(lik_data, generate_ggplot = FALSE, plot_ggplot = FALSE)
# Return tables only (no files written)
nx_tbls <- as.networkx(res, dont_save_csv = TRUE, edges_only = FALSE)
# Default behavior writes CSV files
# as.networkx(res, file = "ResIN_networkx.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.