JAMS.R

peter — Jun 8, 2014, 10:39 AM

#Network visualisation of journal citation data
#Source: Clark, T., Key, T. M., Hodis, M., & Rajaratnam, D. (2014). The intellectual ecology of mainstream marketing research: an inquiry into the place of marketing in the family of business disciplines. Journal of the Academy of Marketing Science, 42(3), 223–241. doi:10.1007/s11747-013-0362-5

library(igraph) #Load network module
setwd("/home/peter/Documents/PhD/") #Set working directory
citations <- read.csv("citations", sep=" ") #Read article data
citations <- citations[-nrow(citations),-ncol(citations)] #remove last row and last column (totals)

g <- graph.adjacency(as.matrix(citations), weighted=T, mode="directed") #Create network
wc <- walktrap.community(g) #Community detection
set.seed(111) #Reproducibility random number seeding
par(mar=rep(0,4)) #Set plot margins
#Plot network graph
plot(wc,g, 
     layout=layout.fruchterman.reingold,
     edge.width=E(g)$weight/1000, #Line width equivalent to numbe rof citations
     edge.color="darkgray",
     vertex.label.color="black",
     vertex.frame.color=NA,
     vertex.size=colSums(citations)/800, #Node size related to number of citations in other journals
     edge.arrow.size=.3, edge.arrow.width=.3
     )

plot of chunk unnamed-chunk-1