add.edges.networkLite {networkLite}R Documentation

Methods to Add or Modify Edges in a networkLite.

Description

Methods to Add or Modify Edges in a networkLite.

Usage

## S3 method for class 'networkLite'
add.edges(x, tail, head, names.eval = NULL, vals.eval = NULL, ...)

## S3 replacement method for class 'networkLite'
x[i, j, names.eval = NULL, add.edges = FALSE] <- value

Arguments

x

A networkLite.

tail

Vector of tails of edges to add to the networkLite.

head

Vector of heads of edges to add to the networkLite.

names.eval

Names of edge attributes, or NULL to indicate that attributes are not being specified. For add.edges, this argument should be structured as a list of length equal to length(tail), each element of which is a character vector of attribute names for the corresponding edge. For the replacement method ⁠[<-.networkLite⁠, this should argument should be a single attribute name, which is applied to all edges.

vals.eval

Value(s) of edge attributes, or NULL to indicate that attributes are not being specified. This argument should be structured as a list of length equal to length(tail), each element of which is a list of attribute values, in the same order as the corresponding attribute names in names.eval.

...

additional arguments

i, j

Nodal indices (must be missing for networkLite method).

add.edges

logical; should edges being assigned to be added if they are not already present?

value

Edge values to assign (coerced to a matrix).

Value

A networkLite object with edges added (if calling add.edges) or set to specified values (if calling ⁠[<-.networkLite⁠).


[Package networkLite version 1.0.5 Index]