[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Node numbering
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] Node numbering |
Date: |
Tue, 15 Oct 2013 23:00:08 +0200 |
> I have a edgelist where the nodes have been given non-numerical unique
> identifiers, such as PE00056. I have a program that will read through these
> and rename them 0, 1, 2, etc. but is that the best way to do this? Does
> igraph have a function for reading in odd node names?
Yes; you can either read your input files into an R data frame and then use
graph.data.frame to construct a graph, or use the read.graph function with the
"ncol" format -- which is essentially a named edge list. igraph will then
assign numeric IDs to the nodes automatically and store the original names in
the "name" vertex attribute.
--
Tamas