databox : Tools to work with the 'databox' 'API'

The following functions are implemented:

The following data sets are included:

Installation

devtools::install_github("hrbrmstr/databox")
options(width=120)

Usage

library(databox)
library(dplyr)

# current verison
packageVersion("databox")

We can send one or more metrics to databox. They can be combined in a pipe as well. Once they're "pushed" they are cleared from the client object:

databox::client() %>% 
  add_metric("sales", 83000, Sys.Date()) %>% 
  add_metric("sales", 4000, unit="USD") %>% 
  add_metric("expenses", 87500) %>% 
  add_metric("sales", 123000, mattrs=c("channel"="in-person", "cheese"="manchego")) %>% 
  push()

There's a print() method for dco objects as well:

databox::client() %>% 
  add_metric("sales", 83000, Sys.Date()) %>% 
  add_metric("sales", 4000, unit="USD") %>% 
  add_metric("expenses", 87500) %>% 
  add_metric("sales", 123000, mattrs=c("channel"="in-person", "cheese"="manchego")) %>% 
  print()

Also can validate the last push:

glimpse(last_push())

Test Results

library(databox)
library(testthat)

date()

test_dir("tests/")


hrbrmstr/databox documentation built on May 17, 2019, 4:56 p.m.