Some notes for Pajek > R > iGraph
These are mostly so I can find them again (argh)....
Install
R, package iGraph,
PajekIn Pajek "locate" R:
tools > R > locate R ... look in c: > program files > R > R-2.7.1 > bin > Rgui.exe (your mileage and R version may vary)
Load your data into Pajek (with a .net, under networks click on the folder)
Do whatever manipulations in Pajek that you want to do (drop isolates, it's much easier in Pajek)
Tools > R > Send to R > Current network
If you had a version of R open, it will open another. No point in opening R first. When R opens, you'll have the information from pajek:
######################################
R called from Pajek
http://vlado.fmf.uni-lj.si/pub/networks/pajek/
Vladimir Batagelj & Andrej Mrvar
University of Ljubljana, Slovenia
-----------------------------------------------------------------------
The following networks/matrices read:
n1 : C:/Documents and Settings/...(1182)
Use objects() to get list of available objects
Use comment(?) to get information about selected object
Use savevector(v?,'???.vec') to save vector to Pajek input file
Use savematrix(n?,'???.net') to save matrix to Pajek input file (.MAT)
savematrix(n?,'???.net',2) to request a 2-mode matrix (.MAT)
Use savenetwork(n?,'???.net') to save matrix to Pajek input file (.NET)
savenetwork(n?,'???.net',2) to request a 2-mode network (.NET)
Use v?<-loadvector('???.vec') to load vector(s) from Pajek input file
Use n?<-loadmatrix('???.mat') to load matrix from Pajek input file
-----------------------------------------------------------------------It's actually called n1 (yes, they say this, but...)
load the igraph package (packages > load)
You now have to make your adjacency matrix into a "graph"
g<-graph.adjacency(n1, mode=c("directed"), weighted=NULL, diag=TRUE, add.colnames=NULL, add.rownames=NA)
then you can sort of cookbook from the
igraph page.... use their models and their in-progress
tutorial book
Oh and name everything you call, I just did the community detection and forgot to add the name<- in front of it
Labels: sna