himitsu_proxy_envvar <- R6::R6Class(
classname = "himitsu_proxy_envvar",
inherit = himitsu_proxy,
cloneable = FALSE,
private = list(
var = NULL,
read_ = function() {
out <- Sys.getenv(x = private$var, unset = NA_character_)
if (is.na(out)) out <- NULL
out
},
write_ = function(value) {
args <- list(value)
names(args) <- private$var
do.call(Sys.setenv, args)
}
),
public = list(
initialize = function(var) {
private$var <- var
}
)
)
#' @export
proxy_envvar <- function(var) {
himitsu_proxy_envvar$new(var = var)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.