From ee537531505f597aa1a60605a9d6d511230c1d79 Mon Sep 17 00:00:00 2001 From: Harold Date: Fri, 3 Nov 2017 15:59:24 -0400 Subject: [PATCH] Update statebins.R Addressed "show_guide is deprecated" warning by replacing show_guide with show.legend. --- R/statebins.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/statebins.R b/R/statebins.R index 401718b..b90230d 100644 --- a/R/statebins.R +++ b/R/statebins.R @@ -120,7 +120,7 @@ statebins <- function(state_data, state_col="state", value_col="value", gg <- ggplot(st.dat, aes_string(x="col", y="row", label="abbrev")) gg <- gg + geom_tile(aes_string(fill="fill_color")) - gg <- gg + geom_tile(color=state_border_col, aes_string(fill="fill_color"), size=2, show_guide=FALSE) + gg <- gg + geom_tile(color=state_border_col, aes_string(fill="fill_color"), size=2, show.legend=FALSE) gg <- gg + geom_text(color=text_color, size=font_size) gg <- gg + scale_y_reverse() gg <- gg + scale_fill_brewer(palette=brewer_pal, name=legend_title) @@ -226,7 +226,7 @@ statebins_continuous <- function(state_data, state_col="state", value_col="value gg <- ggplot(st.dat, aes_string(x="col", y="row", label="abbrev")) gg <- gg + geom_tile(aes_string(fill=value_col)) gg <- gg + geom_tile(color=state_border_col, - aes_string(fill=value_col), size=3, show_guide=FALSE) + aes_string(fill=value_col), size=3, show.legend=FALSE) gg <- gg + geom_text(color=text_color, size=font_size) gg <- gg + scale_y_reverse() gg <- gg + scale_fill_gradientn(colours = brewer.pal(6, brewer_pal), name=legend_title) @@ -336,7 +336,7 @@ statebins_manual <- function(state_data, state_col="state", color_col="color", gg <- ggplot(st.dat, aes_string(x="col", y="row", label="abbrev")) gg <- gg + geom_tile(aes_string(fill="color")) - gg <- gg + geom_tile(color=state_border_col, aes_string(fill="color"), size=2, show_guide=FALSE) + gg <- gg + geom_tile(color=state_border_col, aes_string(fill="color"), size=2, show.legend=FALSE) gg <- gg + geom_text(color=text_color, size=font_size) gg <- gg + scale_y_reverse() if (is.null(labels)) {