inst/doc/florentine-social-network.R

## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----load, warning=FALSE,message=FALSE----------------------------------------
library(dupNodes)
data("florentine.sn")

## ----self.loops, fig.dim=c(8,6)-----------------------------------------------
library(igraph)
print(V(florentine.sn))
print(E(florentine.sn))
plot(florentine.sn)
print(E(florentine.sn)[which_loop(florentine.sn)])

## ----betweenness,message=FALSE------------------------------------------------
dn.florentine.sn <- dup.nodes.from.graph(florentine.sn)
V(florentine.sn)$DNSLbetweenness <- betweenness.with.duplicated.nodes(dn.florentine.sn)

## ----betweenness.table--------------------------------------------------------
DNSLBetweenness <- data.frame( family=V(florentine.sn)$name, betweenness=V(florentine.sn)$DNSLbetweenness)
knitr::kable(DNSLBetweenness[order(DNSLBetweenness$betweenness, decreasing=TRUE),])

Try the dupNodes package in your browser

Any scripts or data that you put into this service are public.

dupNodes documentation built on June 22, 2024, 7:03 p.m.