import_graph | R Documentation |
Import a variety of graphs from different graph formats and create a graph object.
import_graph(
graph_file,
file_type = NULL,
edges_extra_attr_names = NULL,
edges_extra_attr_coltypes = NULL,
graph_name = NULL,
attr_theme = "default",
write_backups = FALSE,
display_msgs = FALSE
)
graph_file |
A connection to a graph file. When provided as a path to a
file, it will read the file from disk. Files starting with |
file_type |
The type of file to be imported. Options are: |
edges_extra_attr_names |
For |
edges_extra_attr_coltypes |
For |
graph_name |
An optional string for labeling the graph object. |
attr_theme |
The theme (i.e., collection of |
write_backups |
An option to write incremental backups of changing graph
states to disk. If |
display_msgs |
An option to display messages primarily concerned with
changes in graph selections. By default, this is |
A graph object of class dgr_graph
.
## Not run:
# Import a GML graph file
gml_graph <-
import_graph(
system.file(
"extdata/karate.gml",
package = "DiagrammeR"))
# Get a count of the graph's nodes
gml_graph %>%
count_nodes()
# Get a count of the graph's edges
gml_graph %>%
count_edges()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.