R/bump-aes-guides.R

Defines functions bump_aes_guides

bump_aes_guides <- function(guides, original_aes, new_aes) {
  for (g in seq_along(guides)) {
    if (is_protected(guides[[g]], original_aes)) {
      next
    }

    if (names(guides)[[g]] == original_aes) {
      names(guides)[[g]] <- new_aes
      guides[[g]] <- protect(guides[[g]], original_aes)
    }
  }

  guides
}

Try the ggnewscale package in your browser

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

ggnewscale documentation built on Sept. 11, 2024, 9:12 p.m.