igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] RE: how to get vertex names


From: Emile Richard
Subject: [igraph] RE: how to get vertex names
Date: Wed, 25 Aug 2010 14:07:51 +0200

I found the answer to my question : V(gtest)$name

 

 

From: Emile Richard
Sent: mercredi 25 août 2010 12:46
To: 'address@hidden'
Subject: how to get vertex names

 

Hi,

 

Very stupid question : how can I convert a igraph.vs object to a char object ?

 

For example

 

gtest = graph.edgelist(matrix(c('a', 'b', 'a', 'c'),2,2))

 

> V(gtest)[1]

Vertex sequence:

[1] "b"

 

 

I just want to get « b » back as a character.

 

When I use as.character it sends me the vertex id , not the vertex name :

 

> as.character(V(gtest)[1])

[1] "1"

 

Thanks for any help.

 

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]