Giter Club home page Giter Club logo

lumberjack's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.