Reputation: 31
ONE question, probably very simple but I am just starting out (and encountering so many difficulties!)
I want to study the degree distribution of several of my networks. I use degree.distribution and get results. But when I want to graph them with the plot function there is a problem. Isolated vertices do not seem to be represented.
> degree.distribution(net.rel_non_lucra)
[1] 0.45454545 0.13636364 0.09090909 0.13636364 0.04545455 0.09090909 0.04545455
When I read the results in the console the first number indicates that 45% of the vertices are isolated. This is the case in the data table and in the graph. But when I plot the distribution (and compare it with other networks) the 0.45 are associated with a degree 1.
Do I have to modify the steps and the axes etics myself? If yes how ? Or is there an error somewhere else?
Here data about the network :
E(net.rel_non_lucra)
22/22 vertices, named, from e732712: 1 N AN PR JB L M LS J BT V L. LC T A C P G B E S AL JL
here the visualization of the graph with the isolated vertices..
Upvotes: 0
Views: 303
Reputation: 101209
I guess you can use proportions(table(degree(g)))
instead of degree.distribution
to contain the degree
info, e.g.,
set.seed(1)
g <- erdos.renyi.game(2000, 1 / 200)
degree_distribution(g)
plot(
type.convert(
rev(stack(proportions(table(degree(g))))),
as.is = TRUE
)
)
If you want CDF, you should use cumsum
in addtion
set.seed(1)
g <- erdos.renyi.game(2000, 1 / 200)
degree_distribution(g)
plot(
type.convert(
rev(stack(proportions(table(degree(g))))),
as.is = TRUE
)
)
Upvotes: 1