R/aaa.R

Defines functions new_scales get_function

#' @noRd
get_function <- function(pkg, fun) {
  if(!requireNamespace(pkg, quietly = TRUE)) {
    stop(pkg, " package has not been installed", call. = FALSE)
  }
  eval(parse(text = paste0(pkg, "::", fun)))
}

#' @importFrom ggnewscale new_scale
#' @noRd
new_scales <- function(...) {
  scales <- list(...)
  if(length(scales) == 0) 
    return(NULL)
  lapply(scales, new_scale)
}
houyunhuang/ggcor documentation built on July 22, 2020, 8:31 p.m.