count_strat: Function for performing contingency analysis of data counts,...

Description Usage Arguments Value Author(s)

View source: R/count_strat.R

Description

Useful for producing stratified sample counts when producing tables for M&S reports. The function uses the base R table() function followed by lots of reformatting and renaming to produce a more useful output.

Usage

1
count_strat(data, strat_col1, strat_col2 = "", pct = "by_col")

Arguments

data

data for analysis as a data frame.

strat_col1

name of first column for result stratification.

strat_col2

name of second column for result stratification. can be set to ” if second stratification is not required.

pct

either 'by_col' or 'by_row'. Indicates how count percentages should be calculated.

Value

Results are returned as a nicely formatted data frame.

Author(s)

Rupert Austin


jgrevel/BAST1-R-Library documentation built on May 21, 2019, 10:11 a.m.