ensure
From sparklyr v0.3.11
by Javier Luraschi
Enforce Specific Structure for R Objects
These routines are useful when preparing to pass objects to a Spark routine, as it is often necessary to ensure certain parameters are scalar integers, or scalar doubles, and so on.
Usage
ensure_scalar_integer(object, allow.na = FALSE, allow.null = FALSE, default = NULL)
ensure_scalar_double(object, allow.na = FALSE, allow.null = FALSE, default = NULL)
ensure_scalar_boolean(object, allow.na = FALSE, allow.null = FALSE, default = NULL)
ensure_scalar_character(object, allow.na = FALSE, allow.null = FALSE, default = NULL)
Arguments
- object
- An R object.
- allow.na
- Are
NA
values permitted for this object? - allow.null
- Are
NULL
values permitted for this object? - default
- If
object
isNULL
, what value should be used in its place? Ifdefault
is specified,allow.null
is ignored (and assumed to beTRUE
).
Community examples
Looks like there are no examples yet.