Verifies whether an argument matches formal requirements.

.check(
  x,
  type,
  dim = NULL,
  miss = FALSE,
  min = NULL,
  max = NULL,
  values = NULL,
  inf = FALSE,
  null = FALSE
)

Arguments

x

argument

type

character "string", "scalar", "vector", "matrix"

dim

vector/matrix dimensionality: integer scalar/vector

miss

accept missing values: logical

min

lower limit: numeric

max

upper limit: numeric

values

only accept specific values: vector

inf

accept infinite (Inf or -Inf) values: logical

null

accept NULL: logical

Examples

cornet:::.check(0.5,type="scalar",min=0,max=1)