dag_render {causact}R Documentation

Render the graph as an htmlwidget

Description

Using a causact_graph object, render the graph in the RStudio Viewer.

Usage

dag_render(
  graph,
  shortLabel = FALSE,
  wrapWidth = 24,
  width = NULL,
  height = NULL
)

Arguments

graph

a graph object of class dgr_graph.

shortLabel

a logical value. If set to TRUE, distribution and formula information is suppressed. Meant for communication with non-statistical stakeholders.

wrapWidth

a numeric value. Used to restrict width of nodes. Default is wrap text after 24 characters.

width

a numeric value. an optional parameter for specifying the width of the resulting graphic in pixels.

height

a numeric value. an optional parameter for specifying the height of the resulting graphic in pixels.

Value

Returns an object of class grViz and htmlwidget that is also rendered in the RStudio viewer for interactive buidling of graphical models.

Examples

# Render a simple graph
dag_create() %>%
  dag_node("Demand","X") %>%
  dag_node("Price","Y", child = "X") %>%
  dag_render()

# Hide the mathematical details of a graph
dag_create() %>%
  dag_node("Demand","X") %>%
  dag_node("Price","Y", child = "X") %>%
  dag_render(shortLabel = TRUE)

[Package causact version 0.4.0 Index]