chi_square_benford takes any numerical vector reduces the sample to the specified number of significant digits and performs Pearson's chi-square goodness-of-fit test to assert if the data conforms to Benford's law.chi_square_benford(x = NULL, first_digits = 1, pvalmethod = "asymptotic", pvalsims = 10000)"asymptotic" or "simulate".pvalmethod = "simulate".leading_digits(x,first_digits) versus pbenf(first_digits). x is a numeric vector of arbitrary length. Values of x should be continuous, as dictated by theory, but may also be integers.
first_digits should be chosen so that leading_digits(x,first_digits) is not influenced by previous rounding.pbenf