Re: [R] per-vertex statistics of edge weights

2012-08-15 Thread Gábor Csárdi
On Wed, Aug 15, 2012 at 2:04 PM, Sam Steingold wrote: > I have a graph with edge and vertex weights, stored in two data frames: > > --8<---cut here---start->8--- > vertices <- data.frame(vertex=c("a","b","c","d"),weight=c(1,2,1,3)) > edges <- data.frame(src=c("a

Re: [R] per-vertex statistics of edge weights

2012-08-15 Thread Sam Steingold
> * Sam Steingold [2012-08-15 14:04:18 -0400]: > >> sapply(vertices$vertex, function (v) mean(E(g)[inc(v)]$weight)) > Note: no visible global function definition for 'inc' > [1] 1.33 1.00 2.50 1.67 > > but I was wondering if this is TRT, given the correct answer with a > scary not

[R] per-vertex statistics of edge weights

2012-08-15 Thread Sam Steingold
I have a graph with edge and vertex weights, stored in two data frames: --8<---cut here---start->8--- vertices <- data.frame(vertex=c("a","b","c","d"),weight=c(1,2,1,3)) edges <- data.frame(src=c("a","a","b","c","d"),dst=c("b","c","d","d","a"), weight=c(1,2,1,