Skip to content

Instantly share code, notes, and snippets.

@bhachauk
Created April 5, 2018 09:59
Show Gist options
  • Save bhachauk/62314e2ce050d4fb7a289587be9b452f to your computer and use it in GitHub Desktop.
Save bhachauk/62314e2ce050d4fb7a289587be9b452f to your computer and use it in GitHub Desktop.
output$metrics <- renderTable ({
inFile <- input$file1
if (is.null(inFile))
return(NULL)
df <- read.csv(inFile$datapath, header =TRUE)[ ,c(input$aend,input$zend,input$linklab)]
net <- graph_from_data_frame(d=df, vertices=NULL, directed=T)
data.frame(
deg=degree(net),
bet=betweenness(net),
clo=closeness(net),
eig=evcent(net)$vector,
tra=transitivity(net,type=c("local"))
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment