On Wed, Aug 15, 2012 at 4:10 PM, Sam Steingold <s...@gnu.org> wrote: [...] > Also, this takes forever and consumes almost all 8GB RAM. > It has been running on > > --8<---------------cut here---------------start------------->8--- > IGRAPH DNW- 18590 6734992 -- > + attr: name (v/c), count (v/n), weight (e/n) > --8<---------------cut here---------------end--------------->8--- > > for an hour and a half now. [...]
g <- erdos.renyi.game(18590, 6734992, type="gnm") E(g)$weight <- runif(ecount(g)) and then al <- get.adjedgelist(g) w <- E(g)$weight tmp <- sapply(al, function(e) mean(w[e])) is fairly quick: > system.time(tmp <- sapply(al, function(e) mean(w[e]))) user system elapsed 1.353 0.069 1.458 Gabor -- Gabor Csardi <csa...@rmki.kfki.hu> MTA KFKI RMKI ______________________________________________ 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.