Nothing
transform
argument correctlyCode
envvar_get("HOME", transform = TRUE)
Condition
Error in `envvar_get()`:
! `transform` must be a function
validate
argument correctlyCode
envvar_get("HOME", validate = TRUE)
Condition
Error in `envvar_get()`:
! `validate` must be a function
default
is NULL)Code
envvar_get("TESTENV_ENVVAR")
Condition
Error in `envvar_get()`:
! Environment variable `TESTENV_ENVVAR` is not set.
default
givenCode
expect_equal(envvar_get("TESTENV_ENVVAR", default = "HELLO"), "HELLO")
Message
i Environment variable `TESTENV_ENVVAR` is not set. Using default value "HELLO".
validate
function works as expectedCode
envvar_get("TESTENV_ENVVAR", validate = function(x) nchar(x) == 50L)
Condition
Error in `envvar_get()`:
! "HELLO" is not a valid value for `TESTENV_ENVVAR`
Code
envvar_get_oneof("TESTENV_ENVVAR", choices = c("APPLE", "DUCK"))
Condition
Error in `envvar_get()`:
! "HELLO" is not a valid value for `TESTENV_ENVVAR`
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.