# NOT RUN {
# Create a random graph
random_graph <-
create_random_graph(
n = 10, m = 22,
set_seed = 23)
# Get the mean outdegree value from all
# nodes in the graph
get_agg_degree_out(
graph = random_graph,
agg = "mean")
#> [1] 3.666667
# Other aggregation functions can be used
# (`min`, `max`, `median`, `sum`); let's
# get the median in this example
get_agg_degree_out(
graph = random_graph,
agg = "median")
#> [1] 3
# The aggregation of outdegree can occur
# for a subset of the graph nodes and this
# is made possible by specifying `conditions`
# for the nodes
get_agg_degree_out(
graph = random_graph,
agg = "mean",
conditions = value < 5.0)
#> [1] 3.666667
# }
Run the code above in your browser using DataLab