graph: Any class of accepted graph format (see netdiffuseR-graphs).
cmode: Character scalar. Either "indegree", "outdegree" or "degree".
undirected: Logical scalar. When TRUE only the lower triangle of the adjacency matrix will considered (faster).
self: Logical scalar. When TRUE autolinks (loops, self edges) are allowed (see details).
valued: Logical scalar. When TRUE weights will be considered. Otherwise non-zero values will be replaced by ones.
x: An diffnet_degSeq object
breaks: Passed to hist.
freq: Logical scalar. When TRUE the y-axis will reflex counts, otherwise densities.
y: Ignored
log: Passed to plot (see par).
hist.args: Arguments passed to hist.
slice: Integer scalar. In the case of dynamic graphs, number of time point to plot.
xlab: Character scalar. Passed to plot.
ylab: Character scalar. Passed to plot.
...: Further arguments passed to plot.
Returns
A numeric matrix of size n∗T. In the case of plot, returns an object of class histogram.
Examples
# Comparing degree measurements ---------------------------------------------# Creating an undirected graphgraph <- rgraph_ba()graph
data.frame( In=dgr(graph,"indegree", undirected =FALSE), Out=dgr(graph,"outdegree", undirected =FALSE), Degree=dgr(graph,"degree", undirected =FALSE))# Testing on Korean Family Planning (weighted graph) ------------------------data(kfamilyDiffNet)d_unvalued <- dgr(kfamilyDiffNet, valued=FALSE)d_valued <- dgr(kfamilyDiffNet, valued=TRUE)any(d_valued!=d_unvalued)# Classic Scale-free plot ---------------------------------------------------set.seed(1122)g <- rgraph_ba(t=1e3-1)hist(dgr(g))# Since by default uses logscale, here we suppress the warnings# on points been discarded for <=0.suppressWarnings(plot(dgr(g)))