Researchers may want to save or work with networks outside R. The following functions offer ways to export to some common external file formats:

  • write_matrix() exports an adjacency matrix to a .csv file.

  • write_edgelist() exports an edgelist to a .csv file.

  • write_nodelist() exports a nodelist to a .csv file.

  • write_pajek() exports Pajek .net files.

  • write_ucinet() exports a pair of UCINET files in V6404 file format (.##h, .##d).

  • write_graphml() exports GraphML files.

write_matrix(.data, filename, ...)

write_edgelist(.data, filename, ...)

write_nodelist(.data, filename, ...)

write_pajek(.data, filename, ...)

write_ucinet(.data, filename, name)

write_graphml(.data, filename, ...)

Source

write_ucinet() kindly supplied by Christian Steglich, constructed on 18 June 2015.

Arguments

.data

An object of a manynet-consistent class:

  • matrix (adjacency or incidence) from {base} R

  • edgelist, a data frame from {base} R or tibble from {tibble}

  • igraph, from the {igraph} package

  • network, from the {network} package

  • tbl_graph, from the {tidygraph} package

filename

Character string filename. If missing, the files will have the same name as the object and be saved to the working directory. An appropriate extension will be added if not included.

...

Additional parameters passed to the write function.

name

Character string to name the network internally, e.g. in UCINET. By default the name will be the same as the object.

Value

The write_functions export to different file formats, depending on the function.

A pair of UCINET files in V6404 file format (.##h, .##d)

Details

Note that these functions are not as actively maintained as others in the package, so please let us know if any are not currently working for you or if there are missing import routines by raising an issue on Github.

See also

as

Other makes: create, generate, learning, play, read