I have two adjacency matrices of a dynamic network in text files, period 1 and 2 in R (igraph). I'd like to color the vertices and edges that are new in the second network in green.
For example the first network could look like this:
1 3 6 10 11
1 NA NA NA NA NA
3 NA NA NA NA NA
6 NA NA NA 8.695652174 13.04347826
10 NA NA 2.586206897 NA 3.448275862
11 NA NA NA 2.919708029 NA
and changes then to this second network:
1 2 3 6 10
1 NA NA NA NA NA
2 NA NA NA NA NA
3 NA NA NA NA NA
6 NA NA NA 12.32091691 8.022922636
10 NA NA 7.228915663 NA NA
The code to read in R:
t1 <- structure(matrix(c(NA,NA,NA,NA,NA,
NA,NA,NA,NA,NA,
NA,NA,NA,8.695652174,13.04347826,
NA,NA,2.586206897,NA,3.448275862,
NA,NA,NA,2.919708029,NA),nrow=5, ncol=5, byrow=TRUE),
dimnames=list(c(1,3,6,10,11), c(1,3,6,10,11)))
t2 <- structure(matrix(c(NA,NA,NA,NA,NA,
NA,NA,NA,NA,NA,
NA,NA,NA,NA,NA,
NA,NA,12.32091691,8.022922636,NA,
NA,NA,7.228915663,NA,NA),nrow=5, ncol=5, byrow=TRUE),
dimnames=list(c(1,2,3,6,10), c(1,2,3,6,10)))
t3 <- structure(matrix(c(NA,NA,NA,NA,NA, NA,NA,7.2289,NA,NA, NA,10.4798,NA,NA,NA, NA,NA,8.1364,NA,3.8762, NA,NA,NA,NA,NA),nrow=5, ncol=5, byrow=TRUE), dimnames=list(c(1,3,4,6,10), c(1,3,4,6,10)))
How can I link those networks in R, so that R knows which vertices are new?
dput(thing)
to make a pastable representation of a [small] object... – Spacedman