connect: Connect nodes into a pipeline

Description Usage Arguments Details Examples

Description

Pathways are expressed using a simple language. Given nodes A, B, C, and D:

Usage

1

Arguments

x

string describing functional pathway

Details

* 'A' - performs no operations * 'A –> B' := 'h_inode(B) <- A' in the parent frame

Multiple inputs are space delimited

* 'A B –> C' := 'h_inode(C) <- list(A, B)'

Any number of nodes can be chained

* 'A –> B –> C' := 'h_inode(B) <- A; h_inode(C) <- B'

Parentheses can be used to denote branching pathways

* '(A –> B) (C –> D) E' 1. 'h_inode(B) <- A' 2. 'h_inode(D) <- C' 3. 'h_inode(E) <- list(B, D)'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(pied)
library(magrittr)
A <- hwell('a')
B <- hpipe('a -> b')
C <- hpipe('b -> c')
D <- hpipe('b -> c -> d')

h_fun(A) <- function() 'a'
h_fun(B) <- function(x) paste0(x, 'b')
h_fun(C) <- function(x) paste0(x, 'c')
h_fun(D) <- function(x,y) sprintf('(%s)(%s)d', x, y)

connect('(A --> B) (A --> B --> C) --> D')

D()

arendsee/pied documentation built on May 10, 2019, 1:20 p.m.