igraph-help
[Top][All Lists]
Advanced

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

[igraph] Creating an exportable, labelled object from centrality measure


From: Stephen Cranney
Subject: [igraph] Creating an exportable, labelled object from centrality measures
Date: Thu, 10 Apr 2014 08:26:56 -0400

Hi all,

I'm trying to export an object consisting of centrality measures I calculated to a Stata file. Specifically, my nodes are countries and I want the centrality measure associated with the particular country in the object so that I can export it to Stata with one column being country ids and the other column being the centrality measure for that particular country.

 However, for some reason when I calculate the centrality measure the labels do not appear to be attached, so when it is exported to Stata all that I get is one column of centrality measures unattached to any country ids. Below is my code; I'm a newbie to both R and igraph so apologies if this is a very simple question.

Thanks,

Stephen

network<-read.graph("TradeTransitions_pajek_1996.net", format = "pajek")
c_1996<-closeness(network, mode="in")
c_1996<-data.frame(c_1996)
is.data.frame(c_1996)
write.dta(c_1996, "d:/Users/scranney/Desktop/TradeTransitions/c_1996.dta")



--
Stephen Cranney

PhD Student
Graduate Group in Demography
University of Pennsylvania

reply via email to

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