addEdge: Functions to manipulate the nodes and edges within a causal...

View source: R/addEdge.R

addEdgeR Documentation

Functions to manipulate the nodes and edges within a causal loop diagram

Usage

addEdge(CLD)

addNode(CLD)

mediate(CLD)

removeEdge(CLD)

removeNode(CLD)

setPolarity(CLD, edgeIndex, from, to, polarity)

setWeight(CLD, edgeIndex, from, to, weight, ...)

Arguments

CLD

An object of class CLD (see help(CLD)

edgeIndex

A numeric vector of edge indices from the CLD object.

from

A vector of type character, providing the variables at the beginning of each (directional) causal link.

to

A vector of type character, containing the variables at the end of each (directional) causal link. Must be the same length as from.

polarity

A numeric vector containing the edge polarities. Must be the same length as from and to and must contain values in c(-1,0,1). Defaults to 1 for all edges.

weight

A numeric vector containing the edge weights (e.g., importance weights). Must be the same length as from and to and must contain values in 1:5. Defaults to 1 for all edges.

...

additional arguments to formatEdges() or formatNodes. See details.

Details

The functions setPolarity() and setWeight(), accept either a numeric vector of edgeIndex values or equal-length character vectors from and to. Polarity values of 0 represent situations where the direction of the relationship may be different for different subgroups.

Value

An updated CLD object.

Author(s)

Jarrod E. Dalton

Examples

addEdge(1)

jarrod-dalton/causalloop documentation built on May 10, 2022, 8:08 a.m.