gephi_write_nodes: Write igraph/ tidygraph to a format that gephi can read

View source: R/writing_tools.R

gephi_write_nodesR Documentation

Write igraph/ tidygraph to a format that gephi can read

Description

write_nodes will write the nodes, and write_edges will write the edges to a csv file. You will alway want to use the write_edges function, the write nodes function has only added value if the nodes have attributes, such as Label, Age, color etc.

Usage

gephi_write_nodes(graph, path, na = "", verbose = TRUE)

gephi_write_edges(graph, path, na = "", verbose = TRUE)

gephi_write_both(graph, pathedges, pathnodes, na = "", verbose = TRUE)

Arguments

graph

The igraph or tidygraph object your work with

path

The file where to save to e.g.: edges.csv or data/edges.csv

na

How to record missing values, defaults to "", nothing / empty values

verbose

by default these functions are chatty and will tell you what they do if you do not want that, set to FALSE

pathedges

where to save the edges file e.g.: 'edges.csv'

pathnodes

where to save the nodes file e.g.: 'nodes.csv'

Details

If the file is not an igraph / tidygraph object, but a dataframe you could use the write_*_from_df functions. This function will assume the edges are between the first and second column, but you can specify if that is not the case.

Value

invisible original object so you could continue using it in a pipe if you want to

Functions

  • gephi_write_edges: Write nodes data to csv

  • gephi_write_both: Write both node and edge data away

See Also

Other write_graphs: gephi_write_edges_from_df()


RMHogervorst/gephi documentation built on July 9, 2022, 6:50 a.m.