knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(mtb)
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.
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') ) )
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.