I think is good to know that list contain more than 600000 rows with
around 14000 nodes (participants).

?read.table may be unreliable for large matrices and with 14/600
you'll end up with many NA's. You might do better with

nbrs<- scan('nbrs.txt',skip=1,what=list('integer','integer',double(0)))
names(nbrs) <- c('c1','c2','c3')
xtabs(c3~c1+c2,nbrs,sparse=T)

# returns
4 x 9 sparse Matrix of class "dgCMatrix"
      1     2     3     4     5     6     7     8     9
1 .     0.065 0.044 .     .     .     .     .     .
3 0.071 .     .     0.016 0.011 .     .     .     .
4 .     .     0.004 .     .     .     0.004 .     0.004
5 .     .     .     0.010 .     0.011 .     0.009 0.004

Cheers

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to