as_box {rlang} | R Documentation |
Convert object to a box
Description
-
as_box()
boxes its input only if it is not already a box. The class is also checked if supplied. -
as_box_if()
boxes its input only if it not already a box, or if the predicate.p
returnsTRUE
.
Usage
as_box(x, class = NULL)
as_box_if(.x, .p, .class = NULL, ...)
Arguments
x , .x |
An R object. |
class , .class |
A box class. If the input is already a box of
that class, it is returned as is. If the input needs to be boxed,
|
.p |
A predicate function. |
... |
Arguments passed to |
[Package rlang version 1.1.4 Index]