Type: | Package |
Title: | Graphviz Pipeline Plot Based on Grids (grPipe: Graphviz Pipeline) |
Version: | 0.1.0 |
Description: | Create a grid-based graphviz using the following functions: 1 - Creating the data.frame where the nodes are; 2 - Adding and editing nodes; 3 - Plotting these nodes. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
Imports: | DiagrammeR, DiagrammeRsvg, dplyr, magrittr, rsvg, png, grid |
RoxygenNote: | 7.2.0 |
NeedsCompilation: | no |
Packaged: | 2022-06-07 14:28:46 UTC; daniel |
Author: | Daniel Gaspar Gonçalves [aut, cre] |
Maintainer: | Daniel Gaspar Gonçalves <daniel.gaspar.goncalves@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2022-06-09 07:50:05 UTC |
Create New Graphviz Data.Frame (grPipe Nodes)
Description
if nrow or ncol parameters are equal zero, then the output will be an empty data.frame.
Usage
grPipe.create(nrow = 0, ncol = 0)
Arguments
nrow |
integer |
ncol |
integer |
Value
Returns a data.frame with 3 columns (id, id_next and text) where:
if nrow==0 or ncol==0, then return an empty data.frame;
if nrow>0 and ncol>0, then return a data.frame with one row:
id = paste0(LETTERS[nrow], ncol)
id_next = NA
text = NA
Author(s)
Daniel Gaspar Gonçalves
Examples
nodes = grPipe.create()
nodes = grPipe.create(nrow = 2, ncol = 5)
Add or Update grPipe Nodes
Description
add a new node if it doesn't exist or update an existing one.
Usage
grPipe.node(nodes, id, id_next, text)
Arguments
nodes |
data.frame |
id |
character |
id_next |
character |
text |
character |
Value
Returns a data.frame with 3 columns (id, id_next and text) where:
If id and id_next already exist in the data.frame nodes, then return the data.frame nodes with the value text updated;
Otherwise, add a row in the data.frame nodes with the values passed (id, id_next and text) and then return the data.frame nodes.
Author(s)
Daniel Gaspar Gonçalves
Examples
nodes = grPipe.create(2,5)
nodes = grPipe.node(nodes, "A1", "A2", "input")
nodes = grPipe.node(nodes, "A2", "B2", "step 1")
nodes = grPipe.node(nodes, "B2", "B3", "step 2")
nodes = grPipe.node(nodes, "B3", "B4", "step 3")
nodes = grPipe.node(nodes, "B4", "A4", "step 4")
nodes = grPipe.node(nodes, "A4", "A5", "step 5")
nodes = grPipe.node(nodes, "A5", NA, "output")
Plot grPipe Nodes
Description
save grPipe nodes in pngfile path.
Usage
grPipe.plot(
nodes,
pngfile,
title = "",
plot = TRUE,
showGrid = FALSE,
colSpace = 0.5,
rowSpace = 0.5
)
Arguments
nodes |
data.frame |
pngfile |
character |
title |
character |
plot |
logical |
showGrid |
logical |
colSpace |
numeric |
rowSpace |
numeric |
Value
No return value.
Author(s)
Daniel Gaspar Gonçalves
Examples
nodes = grPipe.create(2,5)
nodes = grPipe.node(nodes, "A1", "A2", "input")
nodes = grPipe.node(nodes, "A2", "B2", "step 1")
nodes = grPipe.node(nodes, "B2", "B3", "step 2")
nodes = grPipe.node(nodes, "B3", "B4", "step 3")
nodes = grPipe.node(nodes, "B4", "A4", "step 4")
nodes = grPipe.node(nodes, "A4", "A5", "step 5")
nodes = grPipe.node(nodes, "A5", NA, "output")
grPipe.plot(nodes, tempfile(), showGrid = TRUE)
grPipe.plot(nodes, tempfile(), showGrid = FALSE)