R/R6.R

Defines functions replacements_R6

replacements_R6 <- function(env) {
  unlist(recursive = FALSE, eapply(env, all.names = TRUE,
    function(obj) {
      if (inherits(obj, "R6ClassGenerator")) {
        unlist(recursive = FALSE, eapply(obj,
          function(o) {
            if (inherits(o, "list")) {
              lapply(names(o),
                  function(f_name) {
                  f <- get(f_name, o)
                  if (inherits(f, "function")) {
                    replacement(f_name, env = env, target_value = f)
                  }
})
      }
    }))
}
    }))
}

Try the covr package in your browser

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

covr documentation built on Nov. 9, 2023, 9:07 a.m.