type_check {structenforcement} | R Documentation |
List Type Checking
Description
Given two named objects, go through both and make the types of the second match the types of the first.
Usage
type_check(
template,
target,
with_cast = FALSE,
log_items = c("casts", "missing", "excess", "debug")[c(1, 3)]
)
Arguments
template |
|
target |
|
with_cast |
|
log_items |
|
Value
The target object, with its types appropriately cast.
Examples
type_check(
list("a" = character(0), "b" = integer(0)),
data.frame("a" = c(1,2), "b" = c(3,4)),
TRUE, NULL
)
[Package structenforcement version 0.1.3 Index]