knitr::opts_chunk$set( comment = "#>", collapse = TRUE, warning = FALSE, message = FALSE )
feetures
for feature flags
devtools::install_github("ropenscilabs/feetures")
library("feetures")
initialize object
(z <- Feetures$new(adapter = AdapterMemory$new()))
register a flag
z$register("foo")
if/else conditional
if (z$enabled("foo")) { message("foo for you :)") } else { message("NO foo for you!") }
enable the flag
z$enable("foo")
now try again
if (z$enabled("foo")) { message("foo for you :)") } else { message("NO foo for you!") }
feat <- Feature$new("bar", expiration = Sys.time() + 5) (z <- Feetures$new(adapter = AdapterMemory$new())) z$register(feat) z$features() z$enable(feat$name) z$enabled(feat$name) Sys.sleep(5) z$enabled(feat$name)
FALSE
?feat_if_else(feature = "foo", code = { x <- 5^2 x / 10 })
feetures
in R doing citation(package = 'feetures')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.