Computes the requested degree measure for each node in the graph.

1 2 3 4 5 6 7 8 | ```
dgr(graph, cmode = "degree", undirected = getOption("diffnet.undirected",
FALSE), self = getOption("diffnet.self", FALSE),
valued = getOption("diffnet.valued", FALSE))
## S3 method for class 'diffnet_degSeq'
plot(x, breaks = min(100L, nrow(x)/5),
freq = FALSE, y = NULL, log = "xy", hist.args = list(),
slice = ncol(x), xlab = "Degree", ylab = "Freq", ...)
``` |

`graph` |
Any class of accepted graph format (see |

`cmode` |
Character scalar. Either "indegree", "outdegree" or "degree". |

`undirected` |
Logical scalar. When |

`self` |
Logical scalar. When |

`valued` |
Logical scalar. When |

`x` |
An |

`breaks` |
Passed to |

`freq` |
Logical scalar. When |

`y` |
Ignored |

`log` |
Passed to |

`hist.args` |
Arguments passed to |

`slice` |
Integer scalar. In the case of dynamic graphs, number of time point to plot. |

`xlab` |
Character scalar. Passed to |

`ylab` |
Character scalar. Passed to |

`...` |
Further arguments passed to |

A numeric matrix of size *n * T*. In the case of `plot`

,
returns an object of class `histogram`

.

George G. Vega Yon

Other statistics: `classify_adopters`

,
`cumulative_adopt_count`

,
`ego_variance`

, `exposure`

,
`hazard_rate`

, `infection`

,
`moran`

, `struct_equiv`

,
`threshold`

,
`vertex_covariate_dist`

Other visualizations: `diffusionMap`

,
`drawColorKey`

,
`grid_distribution`

,
`hazard_rate`

, `plot_adopters`

,
`plot_diffnet2`

, `plot_diffnet`

,
`plot_infectsuscep`

,
`plot_threshold`

,
`rescale_vertex_igraph`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ```
# Comparing degree measurements ---------------------------------------------
# Creating an undirected graph
graph <- 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)))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.