R/mapping.R

Defines functions mapping

# basically just a mutable R list
mapping <- function() {

  .data <- vector("list", 0L)

  list(

    get = function(key) {
      .data[[key]]
    },

    contains = function(key) {
      key %in% names(.data)
    },

    insert = function(key, value) {
      .data[[key]] <<- value
    },

    data = function() {
      .data
    }

  )

}

Try the renv package in your browser

Any scripts or data that you put into this service are public.

renv documentation built on May 29, 2024, 9:21 a.m.