View source: R/types.castBoolean.R
types.castBoolean | R Documentation |
Cast boolean values
types.castBoolean( format = "default", value, options = { } )
format |
no options (other than the default) |
value |
boolean to cast |
options |
specify additioanl true values or/and falsevalues |
In the physical representations of data where boolean values are represented with strings,
the values set in trueValues
and falseValues
are to be cast to their logical representation as booleans.
trueValues
and falseValues
are lists which can be customised to user need.
The default values for these are in the additional properties section below.
The boolean field can be customised with these additional properties:
trueValues: ["true", "True", "TRUE", "1"]
falseValues: ["false", "False", "FALSE", "0"]
Types and formats specifications
types.castBoolean(format = "default", value = TRUE) types.castBoolean(format = "default", value = "true") types.castBoolean(format = "default", value = "1") types.castBoolean(format = "default", value = "0") # set options with additional true value types.castBoolean(format = "default", value = "yes", list(trueValues = list("yes"))) # set options with additional false value types.castBoolean(format = "default", value = "no", list(falseValues = list("no")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.