[R] Plotting Mean in plotting degree distribution

2014-03-13 Thread Cyberstarlet
Hi, Please help! I need to plot a degree distribution. so far (see below) i have the following but the problem: i'm plotting the graph. instead I need to plot the degree distribution. library(igraph) dat<- read.graph(file="tf.net", format="pajek") dat<- as.undirected(dat, mode = c("each")) is

Re: [R] Plotting Mean in plotting degree distribution

2011-03-04 Thread Gábor Csárdi
I think this would be rather something like abline(v=mean(degree(G))) Best, Gabor On Thu, Mar 3, 2011 at 8:04 PM, Scott Chamberlain wrote: > library(igraph) > G <- erdos.renyi.game(1000, 1/1000) # a random graph > > dd1 = degree.distribution(G) > > plot(dd1, xlab = "degree", ylab="frequency") >

Re: [R] Plotting Mean in plotting degree distribution

2011-03-03 Thread Scott Chamberlain
library(igraph) G <- erdos.renyi.game(1000, 1/1000) # a random graph dd1 = degree.distribution(G) plot(dd1, xlab = "degree", ylab="frequency") abline(h = mean(dd1)) # the mean would be a horizontal line On Thursday, March 3, 2011 at 4:43 PM, kparamas wrote: > Hi, > > I am plotting degree dis

[R] Plotting Mean in plotting degree distribution

2011-03-03 Thread kparamas
Hi, I am plotting degree distribution of a graph using the function, library(igraph) dd1 = degree.distribution(G) plot(dd1, xlab = "degree", ylab="frequency") I would like to plot the mean of the distribution as a vertical line in the attached plot. Please let me know how to do this. Thanks, K