parse_contingency_table: Parse the contingency table to have exclusively the desired...

View source: R/all_digit_test_helper_functions.R

parse_contingency_tableR Documentation

Parse the contingency table to have exclusively the desired digits and digit places

Description

Parse the contingency table to have exclusively the desired digits and digit places

Usage

parse_contingency_table(
  digitdata,
  contingency_table,
  digit_places,
  skip_first_digit,
  skip_last_digit,
  omit_05
)

Arguments

digitdata

A object of class DigitAnalysis.

contingency_table

The user-input probability table of arbitrary distribution. Overwrites distribution if not NA. Must be a dataframe of the form as benford_table. Defaulted to NA.

  • Check out load(file = "data/benford_table.RData") to see the format of benford_table

digit_places

The indexes of left-aligned digit places to analyze. There are three options:

  • 'all': analyze all digits. Set as default.

  • An numeric array: Perform multiple digit test on the digit places desired to analyze.

  • A number: Perform single digit test on the digit place desired to analyze. If last digit test is desired, pass in -1 or c(-1).

skip_first_digit

TRUE or FALSE: If TRUE, skip first digit place before analysis. Default to FALSE.

skip_last_digit

TRUE or FALSE: If TRUE, skip last digit place before analysis, since we don't want tests to overlap. Default to FALSE. skip_last_digit should overwrite digit_places and skip_first_digits.

omit_05

Whether to omit 0 or both 0 and 5. If omit both 0 and 5, pass in c(0,5) or c(5,0); if omit only 0 pass in 0 or c(0); if omit neither, pass in NA. Default to NA.

Value

Contingency table with exclusively the desired digits and digit places


jlederluis/digitanalysis documentation built on Nov. 5, 2023, 11:46 a.m.