This is a simple package to export files into a csv format that gephi can understand. This package does not interface with the open source network vizualisation software gephi but it writes and reads in the same csv format as gephi.

I’ve found the need to convert tidygraph/igraph objects into a node and edge csv, to visualize in gephi quite often. This should be trivial, but gephi is a bit particular and wants specific column names.

What does the package do?

Writes igraph files to csv format that gephi likes. Really? Gephi reads csv files just fine! Sure but it wants the columns in a particular order and named Source, Target etc. Let’s not do this by hand everytime: AUTOMATE THE BORING STUFF! HACK THE PLANET!

Installation

Install this developmental version with:

Example

  • igraph to csv
  • tidygraph to csv
  • dataframe to csv

Writing out an igraph file to csv:

Technically an tidygraph object is also an igraph object so the writing will work the same.

More specifically if you want to modify your graph and visualize a subset in gephi, here is a tidygraph worked example where I select only the edges that are blue, add a new edge property and write the resuling graph to the :

But is is also possible to write a set of edges when there is no graph object, just a dataframe.

Test coverage statistics ``` r covr::package_coverage(type = "tests") #> gephi Coverage: 30.00% #> R/writing_tools.R: 18.75% #> R/utils.R: 66.67% #> R/read_tools.R: 100.00% ```
file.remove("edges.csv")
#> [1] TRUE
file.remove("edges2.csv")
#> [1] TRUE
file.remove("edges_subset.csv")
#> [1] TRUE