check.distribution: Check for adequaty of distrubution.

Description Usage Arguments Value

Description

Check if the given .data is a distribution and normalise it if necessary with optional laplace correction.

Usage

1
2
3
4
5
6
7
8
check.distribution(
  .data,
  .do.norm = NA,
  .laplace = 1,
  .na.val = 0,
  .warn.zero = F,
  .warn.sum = T
)

Arguments

.data

Numeric vector of values.

.do.norm

One of the three values - NA, T or F. If NA than check for distrubution (sum(.data) == 1) and normalise if needed with the given laplace correction value. if T then do normalisation and laplace correction. If F than don't do normalisaton and laplace correction.

.laplace

Value for laplace correction.

.na.val

Replace all NAs with this value.

.warn.zero

if T then the function checks if in the resulted vector (after normalisation) are any zeros, and print a warning message if there are some.

.warn.sum

if T then the function checks if the sum of resulted vector (after normalisation) is equal to one, and print a warning message if not.

Value

Numeric vector.


tcR documentation built on July 2, 2020, 3:18 a.m.