diff --git a/NAMESPACE b/NAMESPACE index 4c81b35..855cf62 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -16,7 +16,8 @@ importFrom(ggplot2,coord_sf) importFrom(ggplot2,geom_sf) importFrom(ggplot2,ggplot) importFrom(ggplot2,ggtitle) -importFrom(ggplot2,scale_color_gradientn) +importFrom(ggplot2,guides) +importFrom(ggplot2,scale_colour_gradientn) importFrom(ggplot2,scale_fill_gradientn) importFrom(ggplot2,theme_bw) importFrom(lazyeval,f_eval) @@ -50,4 +51,5 @@ importFrom(sf,st_transform) importFrom(stats,quantile) importFrom(stats,setNames) importFrom(tidyr,gather_) +importFrom(utils,getFromNamespace) importFrom(utils,packageVersion) diff --git a/R/imports.R b/R/imports.R index 042dc8e..914456b 100644 --- a/R/imports.R +++ b/R/imports.R @@ -1,5 +1,5 @@ #' @import rerddap -#' @importFrom utils packageVersion +#' @importFrom utils packageVersion getFromNamespace #' @importFrom stats quantile setNames #' @importFrom tidyr gather_ #' @importFrom dplyr arrange between @@ -7,8 +7,8 @@ #' @importFrom scales rescale col_numeric #' @importFrom lazyeval is_formula f_text f_eval #' @importFrom sf st_as_sf st_transform st_crs st_bbox st_graticule -#' @importFrom ggplot2 ggplot geom_sf coord_sf theme_bw scale_color_gradientn -#' scale_fill_gradientn ggtitle aes_string aes_ +#' @importFrom ggplot2 ggplot geom_sf coord_sf theme_bw scale_colour_gradientn +#' scale_fill_gradientn ggtitle aes_string aes_ guides #' @importFrom raster raster nlayers calc ncell nrow ncol crs extent resample #' projectRaster rasterToPolygons values plot brick setExtent isLonLat NULL diff --git a/R/plotdap.R b/R/plotdap.R index b42d80e..234a337 100644 --- a/R/plotdap.R +++ b/R/plotdap.R @@ -190,7 +190,7 @@ add_tabledap <- function(plot, table, var, color = c("#132B43", "#56B1F7"), add_ggplot( plot, geom_sf(data = table, mapping = mapping, size = size, pch = shape, ...), - scale_color_gradientn(name = lazyeval::f_text(var), colours = cols) + scale_colour_gradientn(name = lazyeval::f_text(var), colours = cols) ) ) }