View source: R/03_S7_properties.R
| optional | R Documentation |
Creates an S7 union type that allows for the specified type or NULL.
optional(type)
type |
S7 base class or S7 class. |
This should be used when the S7 class already includes all the necessary validation for the
non-NULL case. Otherwise, create a new S7 property with appropriate validator using
S7::new_property().
An S7 union type that allows for the specified type or NULL.
EDG
# Create an optional character type
optional(S7::class_character)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.