# \donttest{
if (interactive()) {
# establish new Shiny session and new eCerto object
ShinySession <- shiny::MockShinySession$new()
test <- eCerto::eCerto$new()
# view current value stored in specific eCerto slot and register observer
shiny::isolate(eCerto::getValue(test, c("Certification", "data")))
shiny::observeEvent(eCerto::getValue(test, c("Certification", "data")), {
message("Certification$data changed:", eCerto::getValue(test, "Certification")$data)
})
# change value of specific eCerto slot and flush reactivity to trigger observer
shiny::isolate(eCerto::setValue(test, c("Certification", "data"), 5))
ShinySession$flushReact()
shiny::isolate(eCerto::getValue(test, c("Certification", "data")))
}
tmp <- eCerto$new()
shiny::isolate(tmp$c_plot())
shiny::isolate(tmp$c_lab_means())
tmp$c_analytes()
tmp$c_lab_codes()
tmp$a_p()
tmp$a_p("pooling")
ca <- shiny::isolate(tmp$cur_an)
tmp$a_p("pooling")[ca]
shiny::isolate(tmp$e_present())
tmp$c_fltData()
shiny::isolate(tmp$cur_an <- "Fe")
shiny::isolate(tmp$cur_an)
tmp$c_fltData()
x <- shiny::isolate(eCerto::getValue(tmp, c("General", "apm")))
x[[shiny::isolate(tmp$cur_an)]][["lab_filter"]] <- "L2"
shiny::isolate(eCerto::setValue(tmp, c("General", "apm"), x))
tmp$c_fltData()
tmp$c_fltData(recalc = TRUE)
# }
# Only run examples in interactive R sessions
if (interactive()) {
rv <- eCerto$new(init_rv())
setValue(rv, c("Certification", "data"), 5)
getValue(rv, c("Certification", "data")) # is 5?
setValue(rv, c("General", "user"), "Franz")
getValue(rv, c("General", "user"))
}
Run the code above in your browser using DataLab