bill_cross_count {mtb}R Documentation

Summarize times being purchased for individual items' from multiple grocery shopping lists.

Description

bill_cross_count returns a data.table showing how many times each items being listed on individual bills.

Usage

bill_cross_count(
  ldt = list(),
  id = NULL,
  gp = NULL,
  type = "count",
  condstr = ""
)

Arguments

ldt

A list of grocery tables in data.frame format.

id

A column name

gp

A column name or a vector of column names

type

A string in one of the following:

  • count for number of rows in each bill

  • cond for conditional counting

  • condwt for conditional counting with total in parenthesis

condstr

A string for conditional counting

Value

a data.table

Examples


bill_cross_count(list(cbind(col1=c('a','b','c'),col2=c(1,2,3)),
cbind(col1=c('d','c','d'),col2=c(4,5,6))), id='col1')


[Package mtb version 0.1.8 Index]