local_average: Local network averages

View source: R/local_average.R

local_averageR Documentation

Local network averages

Description

Local network averages

Usage

local_average(
  graph_id,
  vertex_ids,
  vertex_values,
  vertex_weights = 1,
  alpha = 0.85,
  nstep_max = 200,
  nworkers = available_cores(),
  precision = 1e-05
)

Arguments

graph_id

the graph to which to add the edges and vertices. Should be of type chickenwire.

vertex_ids

a vector with vertex ids. When omitted it is assumed that the vertex values (vertex_values) are in the same order as used internally.

vertex_values

a vector with vertex values. Can be numeric, factor or character values.

vertex_weights

a vector with vertex weights. Should be numeric and have the same length as vertex_values. Optional.

alpha

probability of continuing the random walk (1-restart probability).

nstep_max

maximum number of iterations.

nworkers

number of threads to use during the calculation.

precision

when updates in the local averages are smaller than precision the algorithm is stopped.

Value

A data.frame. The rows correspond to the vertices.


djvanderlaan/chickenwire-r documentation built on July 19, 2022, 1:16 a.m.