check_type | R Documentation |
Throws an error if x
isn't proper, based on the
type
.
check_type(x, type)
x |
Focal input. |
type |
Type of input that |
NULL
if x
is proper, throwing an error otherwise.
names <- "sam" check_type(x = names, type = "character") names <- 2019 #check_type(x = names, type = "character") # throws error years <- 2019 check_type(x = years, type = "integer") years <- "sam" #check_type(x = years, type = "integer") # throws error
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.