View source: R/type_check.R View source: R/strict.R
strict | R Documentation |
Allow assignment only if input is of correct class and/or type
strict(object, class, allow_null = TRUE)
strict(object, class, allow_null = TRUE)
object |
Object to check and return |
class |
Character vector: class(es) to check against |
allow_null |
Logical: if TRUE, allows NULL objects |
x |
Value to be assigned if class and/or type check passes |
accept.class |
Required class of |
accept.type |
Required type of |
non.null.val |
Function which should have a non-null value when applied to |
Object
E.D. Gennatas
EDG
## Not run:
strict("papaya", "character") # "papaya"
strict(c(1, 2.5, 3.2), "integer") # Error
strict(iris, "list") # Error
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.