Skip to content
Prev 345688 / 398502 Next

Lexical scoping/calling stack issue: R fails to recognize an argument's default value

Hi Duncan,

thanks for answering and I'm very sorry: I was a bit too quick with letting
the example go.

This should be self-contained now:

require("devtools")

## Dependencies //
devtools::install_github("Rappster/conditionr")
devtools::install_github("Rappster/typr")
devtools::install_github("Rappster/nestr")
devtools::install_github("Rappster/reactr", ref = "bug-28")
## Actual package //
devtools::install_github("Rappster/optionr")
require("optionr")

path <- file.path(tempdir(), "test")
create(path, description = getOption("devtools.desc"), check = FALSE,
  rstudio = TRUE)
setwd(path)

container <- initializeOptionContainer(overwrite = TRUE)
setAnywhereOption(id = "x_1", value = TRUE, reactive = TRUE)
getAnywhereOption(id = "x_1")
setAnywhereOption(id = "x_2",
  value = reactr::reactiveExpression(
    !getAnywhereOption(id = "x_1")
  ),
  reactive = TRUE)

getAnywhereOption(id = "x_1")
getAnywhereOption(id = "x_2")

Thanks a lot should you take the time to look into this,
Janko

On Sat, Nov 15, 2014 at 1:13 AM, Duncan Murdoch <murdoch.duncan at gmail.com>
wrote: