peep: peep the pipeline

Description Usage Arguments Value Examples

View source: R/ublo.R

Description

peep some data at one step of a pipeline.

Usage

1
peep(data, ..., printer = print, verbose = FALSE)

Arguments

data

some data

...

function names or expressions that use . as a placeholder for the data

printer

which function use to print

verbose

TRUE to include what is printed

Value

the input data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
if( require(magrittr) ){
  # just symbols
  iris %>% peep(head,tail) %>% summary
  # expressions with .
  iris %>% peep(head(., n=2),tail(., n=3) ) %>% summary
  # or both
  iris %>% peep(head,tail(., n=3) ) %>% summary
  # use verbose to see what happens
  iris %>% peep(head,tail(., n=3), verbose = TRUE) %>% summary
}

ThinkR-open/ThinkR documentation built on July 4, 2018, 12:17 p.m.