@@ -633,7 +633,7 @@ ggplot_build_with_theme <- function(p, theme, ggplot_build = ggplot2::ggplot_bui
633633 # TODO: update version depending on when these PRs are merged.
634634 # https://github.com/tidyverse/ggplot2/pull/3828
635635 # https://github.com/tidyverse/ggplot2/pull/3833
636- if (packageVersion(" ggplot2" ) > " 3.3.1" ) {
636+ if (utils :: packageVersion(" ggplot2" ) > " 3.3.1" ) {
637637 old_scales <- do.call(options , scale_defaults )
638638 on.exit({options(old_scales )}, add = TRUE )
639639 } else {
@@ -645,8 +645,8 @@ ggplot_build_with_theme <- function(p, theme, ggplot_build = ggplot2::ggplot_bui
645645 p $ plot_env $ scale_fill_continuous <- scale_defaults $ ggplot2.continuous.fill
646646 }
647647 if (! identical(qual_codes , NA )) {
648- p $ plot_env $ scale_colour_discrete <- function (... ) discrete_scale(" colour" , " qualitative" , qualitative_pal(qual_codes ), ... )
649- p $ plot_env $ scale_fill_discrete <- function (... ) discrete_scale(" fill" , " qualitative" , qualitative_pal(qual_codes ), ... )
648+ p $ plot_env $ scale_colour_discrete <- function (... ) ggplot2 :: discrete_scale(" colour" , " qualitative" , qualitative_pal(qual_codes ), ... )
649+ p $ plot_env $ scale_fill_discrete <- function (... ) ggplot2 :: discrete_scale(" fill" , " qualitative" , qualitative_pal(qual_codes ), ... )
650650 }
651651 }
652652
0 commit comments