edf2CLD: Convert edge data frame into a causal loop diagram (CLD)...

View source: R/edf2CLD.R

edf2CLDR Documentation

Convert edge data frame into a causal loop diagram (CLD) object

Description

Convert edge data frame into a causal loop diagram (CLD) object

Usage

edf2CLD(edf, ndf, ...)

Arguments

edf

An edge data frame containing at least character columns from and to. This data frame may optionally contain columns polarity and/or weight. See help(CLD) for restrictions on these variables. All other variables are ignored.

ndf

An optional node data frame containing at least a character column node. When ndf is specified, edf2CLD() loads the node information into the CLD object and checks the names of the variables contained in edf$from and edf$to for membership in ndf$node. This data frame may optionally contain a column named group to designate individual variables into groups. All other variables are ignored.

Details

The function searches edf for columns named polarity and weight. If these are found, then these values are passed to CLD() instead of whatever values may be passed as arguments to this function). See example.

For information on formatting nodes separately according to the group variable, see help(CLD).

Value

A newly-created CLD object.

Author(s)

Jarrod E. Dalton

See Also

CLD().

Examples

#note precedence in taking the polarity argument here
edf2CLD(tibble(from=c("a","a"), to=c("b","c"), polarity=-1), polarity=1)
## Not run: 
  edf2CLD(data.frame(from="a", to=c("b","c")))  #produces error
  edf2CLD(data.frame(from="a", to=c("b","c"), stringsAsFactors=FALSE))

## End(Not run)

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