#' Counter Class
#'
#' @field value the current value of the counter, should not be accessed directly
#' @import methods
setRefClass(
"Counter",
fields = list("value" = "integer"),
methods = list(
"initialize" = function() {
# called by CounterClass$new()
.self$value <- 0L
},
"get" = function() {
"increments the counter and return's the new value"
(.self$value <- .self$value + 1L)
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.