Nothing
## ----include = FALSE----------------------------------------------------------
library(optional)
## -----------------------------------------------------------------------------
a <- option(5)
class(a)
## -----------------------------------------------------------------------------
a == 5
a
## -----------------------------------------------------------------------------
a <- option(5)
some(a)
a <- none
some(a)
## -----------------------------------------------------------------------------
c_opt <- make_opt(c)
c_opt(option(2), none, option(5))
c_opt()
## -----------------------------------------------------------------------------
library(magrittr)
a <- 5
match_with(a,
. %>% option(.), paste,
none, function() "Error!"
)
## -----------------------------------------------------------------------------
a <- 4
match_with(a,
1, function() "Matched exact value",
list(2, 3, 4), fallthrough(function() "Matched in list"),
. %>% if (. > 3)., function(x) paste0("Matched in condition: ",x,">3")
)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.