| maketikz | R Documentation |
Generate Latex tikz code for plotting a temporal DAG, PDAG or PAG.
maketikz(
model,
xjit = 2,
yjit = 2,
markperiods = TRUE,
xpgap = 4,
annotateEdges = NULL,
addAxis = TRUE,
varLabels = NULL,
periodLabels = NULL,
annotationLabels = NULL,
clipboard = TRUE,
rawout = FALSE,
colorAnnotate = NULL,
bendedges = FALSE
)
model |
|
xjit |
How much should nodes within a period be jittered horizontally. |
yjit |
Vertical distance between nodes within a period. |
markperiods |
If |
xpgap |
Horizontal gap between different periods. |
annotateEdges |
If |
addAxis |
If |
varLabels |
Optional labels for nodes (variables). Should be given as a named list, where
the name is the variable name, and the entry is the label, e.g. |
periodLabels |
Optional labels for periods. Should be given as a named list, where
the name is the period name (as stored in the |
annotationLabels |
Optional labels for edge annotations. Only used if |
clipboard |
If |
rawout |
If |
colorAnnotate |
Named list of colors to use to mark edge annotations instead of labels. This
overrules |
bendedges |
If |
Note that it is necessary to read in relevant tikz libraries in the
Latex preamble. The relevant lines of code are (depending a bit on parameter settings):
\usepackage{tikz}
\usetikzlibrary{arrows.meta,arrows,shapes,decorations,automata,backgrounds,petri}
\usepackage{pgfplots}
Silently returns a character vector with lines of tikz code. The function
furthermore has a side-effect. If clipboard = TRUE, the side-effect is that the tikz
code is also copied to the clipboard. If clipboard = FALSE, the tikz code is instead printed
in the console.
# Make tikz figure code from tpdag, print code to screen
data(tpcExample)
tpdag1 <- tpc(tpcExample, order = c("child", "youth", "oldage"), sparsity = 0.01,
test = corTest)
maketikz(tpdag1, clipboard = FALSE)
# Make tikz figure code from tamat, copy code to clipboard
thisdag <- simDAG(5)
rownames(thisdag) <- colnames(thisdag) <- c("child_x", "child_y",
"child_z", "adult_x",
"adult_y")
thistamat <- tamat(thisdag, order = c("child", "adult"))
## Not run:
maketikz(thistamat)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.