
Plot Friendship Paradox Comparison
plot_friendship_paradox.Rd
Plots each node's number of friends (degree) against the mean number of friends among their friends (mean neighbor degree), with a 1:1 reference line. Useful for visualizing the strength and spread of the friendship paradox.
Arguments
- graph
An
igraph
ortidygraph::tbl_graph
object.- label
Logical. If TRUE, adds node labels.
- point_size
Size of points in the scatterplot.
- ...
Additional arguments passed to
ggplot2::geom_point()
.
Examples
library(tidygraph)
#>
#> Attaching package: ‘tidygraph’
#> The following object is masked from ‘package:igraph’:
#>
#> groups
#> The following object is masked from ‘package:stats’:
#>
#> filter
library(ggplot2)
g <- simulate_feld_1991_tbl()
#> Error in simulate_feld_1991_tbl(): could not find function "simulate_feld_1991_tbl"
plot_friendship_paradox(g)
#> Error: object 'g' not found