Displaying 2 results from an estimated 2 matches for "nonweighted_govsov".
2012 Aug 22
3
help
...265 vectors with dimensions: the number of nodes each week.
In the following code I tried, the program just write one vector called indeg[i] corresponding to the last week, where I would like indeg1, indeg2,...,indeg265.
Rm(list())
library(R.matlab)
library(igraph)
path<-("D:/adj_matrices/nonweighted_GOVSOV")
setwd(path)
vector.files<-paste("nonweighted_GOVSOV",1:265, ".mat",sep="")
dat<-list()
for(i in 1:265) {
dat[[i]] <-readMat(file.path(path,vector.files[i]))
adj<-do.call(rbind, dat[[i]])
g<-graph.adjacency(adj, mode=c("directed"), weigh...
2012 Aug 14
1
Help needed in reading matlab files
...his does not help me, as I try to set up a loop for 265 matlab adj matrix, each number representing a specific week and the purpose being to have metrics from igraph being generated over the 265 weeks.
Thank you
CODE to read the file:
rm(list=ls())
library(R.matlab)
path<-setwd("V:/2012/nonweighted_GOVSOV")
pattern_adj<-sprintf("weightmatrix1.mat")
pathnames_adj<-list.files(pattern=pattern_adj,path=path,full.names=T)
cat("Reading MAT file: ", basename(pathnames_adj), "\n", sep="")
mat_adj<-readMat(pathnames_adj)
adj<-do.call(rbind,mat_adj)
lib...