---
title: "LineWise" 
author: "Author: Daniela Cassol, Le Zhang, and Thomas Girke"
date: "Last update: `r format(Sys.time(), '%d %B, %Y')`" 
output:
  BiocStyle::html_document:
    toc_float: true
    code_folding: show
package: systemPipeR
vignette: |
  %\VignetteEncoding{UTF-8}
  %\VignetteIndexEntry{LineWise}
  %\VignetteEngine{knitr::rmarkdown}
fontsize: 14pt
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# Build the Workflow 

- Add first step

```{r firstStep, eval=TRUE, spr=TRUE}
appendStep(sal) <- LineWise(code={
 mapply(
   function(x, y) write.csv(x, y),
   split(iris, factor(iris$Species)),
   file.path("results", paste0(names(split(iris, factor(iris$Species))), ".csv")))
  }, 
  step_name = "firstStep", 
  dependency = NA)
```

- Add second step

```{r secondStep, eval=TRUE, spr=TRUE}
appendStep(sal) <- LineWise(code={
 setosa <- read.delim("results/setosa.csv", sep = ",")
 versicolor <- read.delim("results/versicolor.csv", sep = ",")
 virginica <- read.delim("results/virginica.csv", sep = ",")
  }, 
  step_name = "secondStep", 
  dependency = "firstStep")
```
