linkcomm.pdf

install.packages("linkcomm")
library(linkcomm)
demo(topic = "linkcomm", package = "linkcomm")
head(lesmiserables)

lc <- getLinkCommunities(lesmiserables, hcmethod = "single")
print(lc)


plot(lc, type = "graph", layout = layout.fruchterman.reingold)
plot(lc, type = "graph", layout = "spencer.circle")
plot(lc, type = "graph", layout = "spencer.circle", shownodesin = 3)
plot(lc, type = "members")
plot(lc, type = "summary")
plot(lc, type = "dend")

getAllNestedComm(lc)
getNestedHierarchies(lc, clusid = 9)
plot(lc, type = "graph", clusterids = c(9,11))


cr <- getClusterRelatedness(lc, hcmethod = "ward")
cutDendrogramAt(cr, cutat = 1.2)


cc <- getCommunityCentrality(lc)

head(sort(cc, decreasing = TRUE))
head(lc$numclusters)

cm <- getCommunityConnectedness(lc, conn = "modularity")
plot(lc, type = "commsumm", summary = "modularity")

lc <- getLinkCommunities(lesmiserables, edglim = 10)
linkcomm2cytoscape(lc, interaction = "pp", ea = "linkcomms.ea")

lm <- getLinkCommunities(lesmiserables, plot = FALSE)
nf <- graph.feature(lm, type = "nodes", indices = which(V(lm$igraph)$name == "Valjean"),features = 30, default = 5)
plot(lm, type = "graph", vsize = nf, vshape = "circle", shownodesin = 4)


nf <- graph.feature(lm, type = "nodes", indices = getNodesIn(lm, clusterids = 1,type = "indices"), features = 30, default = 5)
plot(lm, type = "graph", vsize = nf, vshape = "circle", vlabel = FALSE)

ef <- graph.feature(lm, type = "edges", indices = getEdgesIn(lm, clusterids = 14),features = 5, default = 1)
plot(lm, type="graph", ewidth = ef)


ef <- graph.feature(lm, type = "edges", indices = getEdgesIn(lm, nodes = "Myriel"),features = 5, default = 1)
nf <- graph.feature(lm, type = "nodes", indices = which(V(lm$igraph)$name == "Myriel"),features = 30, default = 5)
plot(lm, type = "graph", vsize = nf, ewidth = ef, vshape = "circle", vlabel = FALSE)