mtb: Summary from Multiple Tables"

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(mtb)

Background

Assume that for each month, items purchased in each grocery store visit are recorded in a table. At the end of a year, we may want to generate a summary table that shows how many times each item being purchased over the year and also list some summary statistics.

How to use

This is a basic example which shows you how to summarize item frequency from multiple tables.

library(mtb)
head(exdt[[1]])

This is a basic example which shows you how to create a cross-count table:

head(bill_cross_count(exdt[1:6], id='name', gp=c('category1'), type = 'count' ) )

This is a basic example which shows you how to create a cross-count table with conditions:

head(bill_cross_count(exdt[1:6], id='name', gp=c('category1'), type = 'cond', condstr='store==2' ) )

This is a basic example which shows you how to create a cross-count table with conditions and total:

head(bill_cross_count(exdt[1:6], id='name', gp=c('category1'), type = 'condwt', condstr='store==1' ) )

This is a basic example which shows you how to cross-check differences in two table:

head(bill_cross_check(exdt[[1]], exdt[[2]], id=c('category1', 'name','store') ) )


Try the mtb package in your browser

Any scripts or data that you put into this service are public.

mtb documentation built on Oct. 21, 2022, 1:05 a.m.