peek: peek at the results in a dplyr pipeline

Description Usage Arguments Details Examples

View source: R/peek.R

Description

peek at the results in a dplyr pipeline

Usage

1
peek(df, n = 5, message = NULL)

Arguments

df

dataframe in pipeline

n

number of rows to show

message

give a message along with peeking at the data

Details

A wrapper around giving a head and tail command but only as a side effect so the original data frame is passed along to continue on for furthermanipulation in the pipeline

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(dplyr)
Theoph %>% select(Subject, Time, conc) %>% peek %>% group_by(Subject) %>% 
summarize(cmax = max(conc)) 

Theoph %>% select(Subject, Time, conc) %>% peek(message = "after select") %>% 
 group_by(Subject) %>% 
summarize(cmax = max(conc)) 

# nice for saving full objects but still seeing their output
cmax_theoph <- Theoph %>% select(Subject, Time, conc) %>% 
peek(message = "after select") %>% 
 group_by(Subject) %>% 
summarize(cmax = max(conc)) %>% peek 
cmax_theoph # still saves full output

PKPDmisc documentation built on April 14, 2020, 5:49 p.m.