diff --git a/dev/LICENSE.html b/dev/LICENSE.html index 77d66243..9f6fe098 100644 --- a/dev/LICENSE.html +++ b/dev/LICENSE.html @@ -1,5 +1,5 @@ -
Straub B, Bundfuss S, Dickinson J, Farrugia R, Gautier F, Mancini E, Mascary S, Miller G, Sjoberg D, Thoma S, Zhang K, Zhu Z (2024). admiraldev: Utility Functions and Development Tools for the Admiral Package Family. -R package version 1.1.0.9005, +R package version 1.1.0.9006, https://github.com/pharmaverse/admiraldev/, https://pharmaverse.github.io/admiraldev/.
@Manual{, title = {admiraldev: Utility Functions and Development Tools for the Admiral Package Family}, author = {Ben Straub and Stefan Bundfuss and Jeffrey Dickinson and Ross Farrugia and Fanny Gautier and Edoardo Mancini and Sadchla Mascary and Gordon Miller and Daniel Sjoberg and Stefan Thoma and Kangjie Zhang and Zelos Zhu}, year = {2024}, - note = {R package version 1.1.0.9005, + note = {R package version 1.1.0.9006, https://github.com/pharmaverse/admiraldev/}, url = {https://pharmaverse.github.io/admiraldev/}, }
Objects passed to assert_list_element() via the ... argument can now be used in the glue expression specified for the message_text argument. (#469)
assert_list_element()
...
message_text
The required_unit argument of assert_unit() has been enhanced. It is now possible to specify more than one unit or not specify it at all. In the latter case only the uniqueness of the unit is checked. (#468)
required_unit
assert_unit()
The assert_numeric_vector() function gained an optional length argument to check whether the vector has a specific length. (#473)
assert_numeric_vector()
length
assert_numeric_vector( arg, + length = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, @@ -69,6 +70,11 @@ Argumentslength +Expected length +If the argument is not specified or set to NULL, any length is accepted. + + optional Is the checked argument optional? If set to FALSE and arg is NULL then an error is thrown @@ -144,6 +150,14 @@ Examplestry(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `num` must be a numeric vector, but it is a character vector. + +example_fun <- function(num) { + assert_numeric_vector(num, length = 2) +} + +try(example_fun(1:10)) +#> Error in example_fun(1:10) : +#> Argument `num` must be a vector of length 2, but has length 10.
Expected length
If the argument is not specified or set to NULL, any length is accepted.
NULL
Is the checked argument optional? If set to FALSE and arg is NULL then an error is thrown
FALSE
arg