Thanks to visit codestin.com
Credit goes to github.com

Skip to content

thebioengineer/lumberjack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lumberjack -- the pipe operator that logs

Build Status Coverage Status CRAN Downloads

A function composition operator ('pipe') and extensible framework that allows for easy logging of changes in data.

Installation

install.packages('lumberjack')

Usage

To log changes in data, you need to attach a logger, and use the lumberjack operator %>>%.

> out <- iris %>>%     # feed iris
+   start_log() %>>%   # tag for logging
+   identity() %>>%    # do nothing
+   head() %>>%        # cut of the head
+   dump_log()         # dump log
Dumped a log at /home/mark/projects/lumberjack/simple_log.csv
> 
> # the processed data is here:
> 
> out[1:3]
  Sepal.Length Sepal.Width Petal.Length
1          5.1         3.5          1.4
2          4.9         3.0          1.4
3          4.7         3.2          1.3
4          4.6         3.1          1.5
5          5.0         3.6          1.4
6          5.4         3.9          1.7
> 
> # the log is here:
> read.csv("simple_log.csv")
  step                time expression changed
1    1 2017-06-01 12:08:03 identity()   FALSE
2    2 2017-06-01 12:08:03     head()    TRUE

The start_log function takes as its argument a logging object, which is a Reference or a R6 class implementing two methods: $add and $dump. Other than that it is completely flexible and users can write their own loggers as desired.

About

The not-a-pipe operator that logs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 92.7%
  • Shell 7.3%