young-researcher-network.R

Uploaded by:fwild

              
library(network)

setwd("~/public/telmap/yrsi")

#data = read.csv("young-researcher-network.csv", header=TRUE, row.names="X")
data = read.csv("young-researcher-network-by-articles.csv", header=TRUE, row.names="X")
data = t(data)
data[which(is.na(data))] = 0

net = data %*% t(data)
net = network(net, directed=F)
plot(net, label=network.vertex.names(net), displayisolates=T, label.cex=0.7, vertex.cex=2, boxed.labels=F)

net = network(data)
vertexsides = network.vertex.names(net) %in% colnames(data)*4
vertexsides[which(vertexsides==0)] = 50
vertexsides[which(network.vertex.names(net)=="CLUSTER")] = 3
vertexcol = network.vertex.names(net) %in% colnames(data)*1
vertexcol[which(vertexcol==0)] = "#996633"
vertexcol[which(vertexcol==1)] = "#336699"
vertexcol[which(network.vertex.names(net)=="CLUSTER")] = "darkred"
vertexcex = (network.vertex.names(net) == "CLUSTER")*3+1
plot(net, label=network.vertex.names(net), displayisolates=T, label.cex=0.7, vertex.cex=vertexcex, boxed.labels=F, usecurve=F, label.pos = 1, uselen=F, edge.curve=0.001, edge.steps = 500, loop.steps = 200, vertex.sides=vertexsides, vertex.col=vertexcol)