From 2023d49aafcc61536592d90abb352ea4eca51ad7 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Tue, 16 Jan 2024 11:46:44 +0100 Subject: [PATCH] Update vignettes format, correct parameter legend in Robinson vignette and add a note in the VizRobinson documentation to improve the use of target_proj --- R/VizRobinson.R | 8 +++++--- vignettes/{data_loading.md => data_loading.Rmd} | 0 vignettes/{map_proj_equi.md => map_proj_equi.Rmd} | 0 .../{map_proj_robinson.md => map_proj_robinson.Rmd} | 12 ++++++------ .../{map_proj_stereo.md => map_proj_stereo.Rmd} | 0 vignettes/{time_series.md => time_series.Rmd} | 0 6 files changed, 11 insertions(+), 9 deletions(-) rename vignettes/{data_loading.md => data_loading.Rmd} (100%) rename vignettes/{map_proj_equi.md => map_proj_equi.Rmd} (100%) rename vignettes/{map_proj_robinson.md => map_proj_robinson.Rmd} (95%) rename vignettes/{map_proj_stereo.md => map_proj_stereo.Rmd} (100%) rename vignettes/{time_series.md => time_series.Rmd} (100%) diff --git a/R/VizRobinson.R b/R/VizRobinson.R index cb8f250..2e00161 100644 --- a/R/VizRobinson.R +++ b/R/VizRobinson.R @@ -26,9 +26,11 @@ #' 'data'. If it is NULL, the function tries to find the name in #' \code{esviz:::.KnownLatNames}. The default value is NULL. #'@param target_proj A character string indicating the target projection. It -#' should be a valid crs string. The default projection is Robinson -#' (ESRI:54030). Note that the character string may work differently depending -#' on PROJ and GDAL module version. +#' should be a valid crs string. The default projection is Robinson: +#' "ESRI:54030". Note that the character string may work differently depending +#' on PROJ and GDAL module version. If package version 'sf' is lower than +#' "1.0.10" and an error appears regarding the target crs, you can try with +#' numeric crs (e.g. target_proj = 54030). #'@param drawleg A character string indicating the legend style. It can be #' 'bar' (color bar by \code{ColorBarContinuous()}), 'ggplot2' (discrete legend #' by ggplot2), or FALSE (no legend). The default value is 'bar'. diff --git a/vignettes/data_loading.md b/vignettes/data_loading.Rmd similarity index 100% rename from vignettes/data_loading.md rename to vignettes/data_loading.Rmd diff --git a/vignettes/map_proj_equi.md b/vignettes/map_proj_equi.Rmd similarity index 100% rename from vignettes/map_proj_equi.md rename to vignettes/map_proj_equi.Rmd diff --git a/vignettes/map_proj_robinson.md b/vignettes/map_proj_robinson.Rmd similarity index 95% rename from vignettes/map_proj_robinson.md rename to vignettes/map_proj_robinson.Rmd index 4908340..6db8f21 100644 --- a/vignettes/map_proj_robinson.md +++ b/vignettes/map_proj_robinson.Rmd @@ -63,7 +63,7 @@ VizRobinson(rmsss$rmsss[1, , ], lon = lons, lat = lats, target_proj = "ESRI:54030", dots = !rmsss$sign[1, , ], dots_size = 0.7, brks = brks, cols = cols, col_inf = col_inf, - style = 'point', legend = 'bar', + style = 'point', drawleg = 'bar', toptitle = "RMSSS SEAS5-ERA5 monthly tas anomaly Nov 2011-2016", caption = "Projection: Robinson ESRI:54030", width = 10, height = 6, @@ -85,7 +85,7 @@ VizRobinson(rmsss$rmsss[1, , ], lon = lons, lat = lats, mask = !rmsss$sign[1, , ], color_fun = ClimPalette("yellowred"), brks = 21, bar_limits = c(-1, 1), - style = 'point', legend = 'bar', + style = 'point', drawleg = 'bar', toptitle = "RMSSS SEAS5-ERA5 monthly tas anomaly Nov 2011-2016", caption = "Projection: Mollweide ESRI:54009", width = 10, height = 6, @@ -132,9 +132,9 @@ lons_eu <- attributes(exp_eu)$Variables$system5c3s$lon ## style = point VizRobinson(rmsss_eu$rmsss[1, , ], lon = lons_eu, lat = lats_eu, target_proj = "ESRI:102014", - style = 'point', legend = 'bar', + style = 'point', drawleg = 'bar', mask = !rmsss_eu$sign[1, , ], - brks = 21, cols = cols, bar_limits = c(-0.8, 0.8), + brks = 21, bar_limits = c(-0.8, 0.8), bar_extra_margin = c(0.6, 3, 0.6, 3), point_size = 1.3, crop_coastlines = c(lonmin = -20, lonmax = 40, latmin = 27, latmax = 70), @@ -146,9 +146,9 @@ VizRobinson(rmsss_eu$rmsss[1, , ], lon = lons_eu, lat = lats_eu, ## style = polygon VizRobinson(rmsss_eu$rmsss[1, , ], lon = lons_eu, lat = lats_eu, target_proj = "ESRI:102014", - style = 'polygon', legend = 'bar', + style = 'polygon', drawleg = 'bar', mask = !rmsss_eu$sign[1, , ], - brks = 21, cols = cols, bar_limits = c(-0.8, 0.8), + brks = 21, bar_limits = c(-0.8, 0.8), bar_extra_margin = c(0.6, 3, 0.6, 3), point_size = 1.3, crop_coastlines = c(lonmin = -20, lonmax = 40, latmin = 27, latmax = 70), diff --git a/vignettes/map_proj_stereo.md b/vignettes/map_proj_stereo.Rmd similarity index 100% rename from vignettes/map_proj_stereo.md rename to vignettes/map_proj_stereo.Rmd diff --git a/vignettes/time_series.md b/vignettes/time_series.Rmd similarity index 100% rename from vignettes/time_series.md rename to vignettes/time_series.Rmd -- GitLab