add_tr_count: Collapse data while adding treatment count variable.

Description Usage Arguments

View source: R/add_tr_count.R

Description

add_tr_count takes collapsed data and adds a treatment group variable that reflects the number of observations in that treatment bin. If the counts are unequal within treatment bins, the function gives a warning and adds an asterisk (*) after the count variable, which now represents the minimum of all the counts within each treatment group bin.

Usage

1
add_tr_count(collapsed_data, tr_group_name, count_col_name)

Arguments

collapsed_data

Data that has been aggregated and includes a treatment group variable as well as a count variable on the treatment group level (data.table)

tr_group_name

The name of the column in collapsed_data that contains the names of the corresponding treatment groups (character)

count_col_name

The name of the column in collapsed_data that contains the treatment group-level observation counts (character)


johnnybonney/sales.taxes documentation built on Dec. 7, 2018, 8:01 a.m.