inspect_par_haldane: Validate parameters for the Haldane distribution

Description Usage Arguments Details Value See Also Examples

View source: R/inspect_par_.R

Description

inspect_par_haldane checks if an object is an eligible vector of parameters for the Haldane distribution. This can be useful to validate inputs, intermediate calculations or outputs in user-defined functions.

Usage

1

Arguments

x

An arbitrary object.

Details

inspect_par_haldane conducts a series of tests to check if x is an eligible vector of parameters for the Haldane distribution. Namely, inspect_par_haldane checks if:

Value

inspect_par_haldane does not return any output. There are two possible outcomes:

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Calls that pass silently:
x1 <- c(0, 0, 0)
x2 <- c(0, 0)
inspect_par_haldane(x1)
inspect_par_haldane(x2)

# Calls that throw an informative error message:
mylist <- list(
  NULL, factor(0, 0, 0),
  matrix(c(0, 0, 0)), c("0", "0", "0"), list(0, 0, 0), c(0, NA),
  c(0, NaN, 0), c(TRUE, FALSE), numeric(0), c(1, 0, 0)
)
try(inspect_par_haldane(mylist[[1]]))
try(inspect_par_haldane(mylist[[2]]))
try(inspect_par_haldane(mylist[[3]]))
try(inspect_par_haldane(mylist[[4]]))
try(inspect_par_haldane(mylist[[5]]))
try(inspect_par_haldane(mylist[[6]]))
try(inspect_par_haldane(mylist[[7]]))
try(inspect_par_haldane(mylist[[8]]))
try(inspect_par_haldane(mylist[[9]]))
try(inspect_par_haldane(mylist[[10]]))

inspector documentation built on June 18, 2021, 1:06 a.m.