setEdgeFormat: Functions to format nodes and edges in a causal loop diagram...

View source: R/setEdgeFormat.R

setEdgeFormatR Documentation

Functions to format nodes and edges in a causal loop diagram (CLD)

Description

Functions to format nodes and edges in a causal loop diagram (CLD)

Usage

setEdgeFormat(CLD, property, value, polarity)

setNodeFormat(CLD, groups, ...)

Arguments

CLD

An object of class CLD

property

The property of the edge or node being manipulated. Allowable values are provided in the details.

value

Value of the parameter to be assigned. Note that this is not validated against what values are allowed by GraphViz. See the documentation for GraphViz for a list of allowable values.

polarity

Polarity of edges for which the edge format is being manipulated. When this parameter is not specified, setEdgeFormat() will apply the format change to both positive and negative links (with warning).

...

Format parameters as described in the details section below.

group

Character vector of group label(s) of nodes for which the node format is being manipulated. When this parameter is not specified, setNodeFormat() applies the formatting to all node groups that are currently included in the CLD object (under $formats$node$group).

Details

For setEdgeFormat(), the following parameters are acted upon (all others are ignored):

  • style — Line style (e.g., "solid" or "dotted")

  • color — Line color

  • arrowhead — Arrowhead style (e.g., "vee", "normal", "box", or "diamond").

  • penwidthAdj — Pen width adjustment factor. This gets multiplied by the edge weight to establish the thickness ("pen width") of each line.

For setNodeFormat(), the following parameters are acted upon (all others are ignored):

  • shape — Node shape (e.g., "rectangle", "oval", "box" or "egg")

  • style — Node line style (e.g., "solid", "dashed", "dotted" or "bold")

  • color — Line color for the node shape

  • fillcolor — Fill color for the node

  • fontname — Font for the node label

  • fontcolor — Font color for the node label

  • height — Base height of the node (all graphs are plotted with fixedsize = FALSE, such that height and width change to accomodate the node labels)

  • width — Base width of the node (all graphs are plotted with fixedsize = FALSE, such that height and width change to accomodate the node labels)

Default attributes are adopted unless the attributes are specified through the function.

Value

An updated CLD object.

Examples

L <- CLD(from = c("a","a","c"),
         to   = c("b","c","a")) %>%
  setEdgeFormat("color", "midnightblue", polarity=-1) %>%
  setNodeFormat("fillcolor", "yellow")
#plot(L)

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