R/rm_global_robjs_if_exist.R

Defines functions rm_global_robjs_if_exist

Documented in rm_global_robjs_if_exist

#' Removes global R objects if they exist in the global environment
#' @export

rm_global_robjs_if_exist <-
        function(robj_names) {
                garbage_can <- robj_names
                for (i in 1:length(garbage_can)) {
                        if (exists(garbage_can[i], envir = globalenv())) {
                                rm(list = garbage_can[i], envir = globalenv())
                        }
                }
        }
patelm9/mirCat documentation built on April 24, 2020, 6:24 p.m.