Description Usage Arguments Value Functions Examples
View source: R/isReadableValue.R
Use this method to prevent failures from NULL, NA, or empty values.
1 2 3 | hasReadableValue(value)
isReadableValue(value)
|
value |
usually the value of a property or a user response. |
a single boolean. Return FALSE if value is NULL, NA, empty vector/list or empty string; otherwise return TRUE.
boolean. Return FALSE if value is NULL, NA, empty vector/list or empty string; otherwise return TRUE.
hasReadableValue
: return a single boolean, recommended for logic flow.
Use this method to prevent failures from NULL, NA, or empty values.
isReadableValue
: result may be a vector or matrix reflecting the structure of value; recommended for subsetting.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | hasReadableValue(NA)
#> FALSE
hasReadableValue(c())
#> FALSE
hasReadableValue("")
#> FALSE
hasReadableValue("text")
#> TRUE
# hasReadableValue(c(1,2,3,NA,4))
# #> TRUE
# hasReadableValue(list(a=c(1,2,NA), b=c("app"), c=NA, d=""))
# #> TRUE
isReadableValue(NA)
#> FALSE
isReadableValue(c())
#> FALSE
isReadableValue("")
#> FALSE
isReadableValue("text")
#> TRUE
# isReadableValue(c(1,2,3,NA,4))
# #> TRUE TRUE TRUE FALSE TRUE
# isReadableValue(list(a=c(1,2,NA), b=c("app"), c=NA, d=""))
# #> $a
# #> [1] TRUE TRUE FALSE
# #> $b
# #> [1] TRUE
# #> $c
# #> [1] FALSE
# #> $d
# #> [1] FALSE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.