Add support for SONIA file format
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
igraph |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
Quite simple format, so it is easy:
http://
http://
Here is a quick and dirty R function for the sonia -> igraph conversion:
sonia2igraph <- function(filename, directed=TRUE) {
lines <- readLines(filename)
lines <- grep("^//", lines, value=TRUE, invert=TRUE)
fromid <- grep("^FromId", lines)[1]
nodes <- lines[1:(fromid-1)]
edges <- lines[fromid:
nodes <- strsplit(
nodesnames <- nodes[[1]]
nodes <- data.frame(
colnames(nodes) <- nodesnames
colnames(
edges <- strsplit(
edgesnames <- edges[[1]]
edges <- data.frame(
colnames(edges) <- edgesnames
graph.
}
The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here: /github. com/igraph/ igraph/ issues/ 340
https:/