Description Usage Arguments Value See Also Examples
View source: R/graph_feature.R
'nDegreeDensities' estimates the density functions of the degrees for n graphs at the same coordinates
1 2 3 4 5 6 7 | nDegreeDensities(
Gs,
npoints = 1024,
bandwidth = "Sturges",
from = NULL,
to = NULL
)
|
Gs |
a list of n igraph graphs objects |
npoints |
number of points used in density function estimation |
bandwidth |
a parameters. It can be set to either "Sturges" or "Silverman". |
from |
the lower value used to build the distribution |
to |
the higher value used to build the distribution |
a list containing the components 'x' and 'densities'. The first element is the vector 'x' of 'npoints' coordinates of the points where the density function i estimated, and the second is a vector 'y' of the estimated density values.
1 2 3 4 5 6 7 8 9 10 11 12 | G<-list()
G[[1]]<-erdos.renyi.game(30,0.6)
G[[2]]<-barabasi.game(30,power = 1)
G[[3]]<-watts.strogatz.game(2,30,2,0.3)
d<-nDegreeDensities(G, npoints=1024, bandwidth="Sturges")
par(mfrow=c(1,3))
plot(d$x,d$densities[,1],main="Erdos-Renyi\n Degree distribution",
xlab="Degree",ylab="Frequency")
plot(d$x,d$densities[,2],main="Barabasi\n Degree distribution",
xlab="Degree",ylab="Frequency")
plot(d$x,d$densities[,3],main="Watts-Strogatz\n Degree distribution",
xlab="Degree",ylab="Frequency")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.