igraph / igraph

Library for the analysis of networks
https://igraph.org
GNU General Public License v2.0
1.75k stars 405 forks source link

Add delimiter keyword to write_edgelist #797

Open macks22 opened 9 years ago

macks22 commented 9 years ago

Currently spaces are used. It would be useful to be able to write a standard csv or tsv file, for instance.

gaborcsardi commented 9 years ago

Sounds reasonable. But then maybe for reading as well.

macks22 commented 9 years ago

Indeed. This could also be implied from the extension like the general write/Read methods do. For instance, csv/tsv would be implied comma/tab, and txt might be the space as it currently is. A more general delimiter-separated-value could be ext .dsv and require a format specified. Or several other non-standard options could be defined to accommodate standard delimiters such as .ssv for semi-colons, .psv for pipes, etc. This may get to be too much though, so just sticking with either a delimiter keyword or standard options will probably be simpler.

When reading, you could also imply the delimiter if using a standard header, such as (src,target) for each edgelist file.

iosonofabio commented 5 years ago

I can't seem to find the function write_edgelist in the C library. Maybe R specific? If so should we move the issue to that repo?

szhorvat commented 5 years ago

@iosonofabio I believe this refers to igraph_write_graph_edgelist and igraph_read_graph_edgelist.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

carissableker commented 4 years ago

I would appreciate if the same option could be added to igraph_write_graph_ncol as well.

sajaddp commented 4 years ago

Hi, Is there a plan for this issue after six years?

iosonofabio commented 4 years ago

haha @sajaddp there is a plan! It's a simple fix, so feel free to make a PR for it. Otherwise I'll try to find some time in the next days and it'll make it for the next release