testargs: Assert a function argument is of correct type

Description Usage Arguments Details Author(s)

Description

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
testarg_num(arg, allow_nan = FALSE, allow_na = FALSE)

testarg_pos(arg)

testarg_prop(arg)

testarg_not_this(arg, forbidden)

testarg_char(arg)

testarg_log(arg)

testarg_length(arg, correct_length)

test_comrad_pop(pop)

Arguments

arg

value of the asserted argument.

allow_nan

logical, should NaNs pass the test?

allow_na

logical, should NAs pass the test?

forbidden

a vector containing forbidden values.

correct_length

numeric, the length the argument should have.

pop

a tibble with one row per individual in the population and two columns:

  • z contains (numeric) traits values

  • species contains the species names (characters)

Details

Currenty testarg_not_this() cannot be tested properly.

Author(s)

Theo Pannetier


TheoPannetier/comrad documentation built on Feb. 18, 2020, 6 a.m.