# present data using graph

I have dataset matrix of 100 nodes that present workstations in network. I analyzed their presence durring 24 hours and looked for similarities between nod presence.

you can see that nod in column C have high uptime and it s 100 % available for first 3 nodes (row 2,3,4) but for this nod (first row column c) this first 3 nod are around 70% (further in this matrix). I need some advice how to present this using some graph.

• It is not so clear what you ask, what do the column titles mean? – user83346 Sep 27 '17 at 13:44
• columns are procentage of mutual presence in network ( 0015F238125D is MAC address of nod in network. To clarify during presence of nod with mac address 0015F238125D nod 000021291D71 was also present. but 0011D85F ( 4 th column ) was there in 50% of his time. So I am trying to present this relation using graph because 100 x 100 matrix is not so convenient way. – explorer Sep 27 '17 at 19:44
• So the matrix is symmetric? – user83346 Sep 28 '17 at 4:40
• yes it is, it shows relation between those 100 nodes – explorer Sep 28 '17 at 5:58
• Can I give some ideas with example code in R ? – user83346 Sep 28 '17 at 9:28

I just try to give some ideas. To do that I generate some data (x in de code below, my matrix is not symmetric but it is just an example).

library(ggplot2)
library(reshape2)

x<-matrix(nrow=100,ncol=100, rbeta(n = 10000, shape1 = 5, shape2 = 2))
y<-melt(x)

p<-ggplot(as.data.frame(y), aes(x=Var1, y=Var2))+
# geom_tile(aes(alpha=value))+
coord_fixed() +
geom_tile(aes(fill = value),colour = "white") +
scale_fill_gradient(low = "white", high = "darkred")


if you print this with print(p) then you get a heat map, the darker the red in a cell, the bigger the common availability.

You can also have an idea about the number of nodes that one particular node is 'connected to' by summing over the rows and then graphing this:

nodeDegree<-apply(X=x, MARGIN = 2, FUN = sum)
df<-data.frame(node=as.factor(paste("nod", 1:100,sep="")), deg=nodeDegree)
p<-ggplot(df, aes(x=node, y=deg))+geom_bar(stat="identity")


And then again print(p).

Hope this helps.

• Is there some way to produce graph like star where center of circle is zero percentage and far end is let say 100 % i believe that I will get full circle made of 100 nodes with different distance from center and with their connection. this is just some idea that I am think of .. – explorer Sep 28 '17 at 15:49
• No idea, maybe take a look at the 'graph theory' ? – user83346 Sep 28 '17 at 18:12