Commit 5c2d3c81 authored by Grelot Frederic's avatar Grelot Frederic :swimmer_tone5:
Browse files

Préparation v1.0.29.1 de so.ii

No related merge requests found
Showing with 22 additions and 15 deletions
+22 -15
so.ii Version: 1.0.29.0 so.ii Version: 1.0.29.1
0 errors ✔ | 0 warnings ✔ | 0 notes ✔ 0 errors ✔ | 0 warnings ✔ | 0 notes ✔
**Note de version** **Note de version**
* MAJ de map_so_ii
* MAJ de add_bar * MAJ de add_bar
* MAJ de add_inset
* MAJ de map_so_ii
**Détails** **Détails**
* map_so_ii ajustement de l'appel de add_bar pour permettre de définir * add_bar: correction bug, ajout de "..." comme paramètre
directement depuis l'appel les paramètres de add_bar * add_inset: suppression de warnings pour st_centroid
* add_bar: changement des noms des paramètres pour plus de clarté dans appel * map_so_ii: suppression de message pour st_union du scope
dans map_so_ii
# git tag -a v1.0.29.0 -F dev/tag-message # git tag -a v1.0.29.1 -F dev/tag-message
# git push --tags # git push --tags
Package: so.ii Package: so.ii
Title: Utilities very useful to share within so_ii team Title: Utilities very useful to share within so_ii team
Version: 1.0.28.0 Version: 1.0.28.1
Authors@R: Authors@R:
c( c(
person(given = "Frédéric", person(given = "Frédéric",
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#' @param bar_adj numeric of length 2, adjustment for text placement. #' @param bar_adj numeric of length 2, adjustment for text placement.
#' @param bar_lon numeric of length 1, may be adjusted for some plots with #' @param bar_lon numeric of length 1, may be adjusted for some plots with
#' trial-and-error strategy. #' trial-and-error strategy.
#' @param ... some unused parameters.
#' #'
#' @return NULL. #' @return NULL.
#' #'
...@@ -29,7 +30,8 @@ add_bar = function( ...@@ -29,7 +30,8 @@ add_bar = function(
bar_d = NULL, bar_d = NULL,
bar_xy = NULL, bar_xy = NULL,
bar_adj = NULL, bar_adj = NULL,
bar_lon = 0.4788987 bar_lon = 0.4788987,
...
) { ) {
d = adjust_terra_scale(bar_d) d = adjust_terra_scale(bar_d)
xy = calculate_terra_xy(bar_xy) xy = calculate_terra_xy(bar_xy)
......
...@@ -43,7 +43,7 @@ add_inset = function(x, y, ratio = 1/5, add = TRUE, ...) { ...@@ -43,7 +43,7 @@ add_inset = function(x, y, ratio = 1/5, add = TRUE, ...) {
diff(ext_y[c("xmin", "xmax")]) / diff(ext_x[c("xmin", "xmax")]), diff(ext_y[c("xmin", "xmax")]) / diff(ext_x[c("xmin", "xmax")]),
diff(ext_y[c("ymin", "ymax")]) / diff(ext_x[c("ymin", "ymax")]) diff(ext_y[c("ymin", "ymax")]) / diff(ext_x[c("ymin", "ymax")])
)) ))
centroid = sf::st_centroid(x) centroid = suppressWarnings(sf::st_centroid(x))
x = (x - centroid) * ratio x = (x - centroid) * ratio
ext_x = sf::st_bbox(x) ext_x = sf::st_bbox(x)
ratio_real = stats::setNames(c( ratio_real = stats::setNames(c(
......
...@@ -240,10 +240,12 @@ map_so_ii = function( ...@@ -240,10 +240,12 @@ map_so_ii = function(
warnings("Nothing pertinent found in scope, default value is used.") warnings("Nothing pertinent found in scope, default value is used.")
scope = so.ii::so_ii_limit scope = so.ii::so_ii_limit
} else { } else {
scope = sf::st_union( scope = suppressMessages(
so.ii::so_ii_collectivity[ sf::st_union(
so.ii::so_ii_collectivity[["commune"]] %in% scope, so.ii::so_ii_collectivity[
] so.ii::so_ii_collectivity[["commune"]] %in% scope,
]
)
) )
} }
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
\alias{add_bar} \alias{add_bar}
\title{Add a bar to a map} \title{Add a bar to a map}
\usage{ \usage{
add_bar(bar_d = NULL, bar_xy = NULL, bar_adj = NULL, bar_lon = 0.4788987) add_bar(bar_d = NULL, bar_xy = NULL, bar_adj = NULL, bar_lon = 0.4788987, ...)
} }
\arguments{ \arguments{
\item{bar_d}{integer, size of the bar in km.} \item{bar_d}{integer, size of the bar in km.}
...@@ -17,6 +17,8 @@ the plot.} ...@@ -17,6 +17,8 @@ the plot.}
\item{bar_lon}{numeric of length 1, may be adjusted for some plots with \item{bar_lon}{numeric of length 1, may be adjusted for some plots with
trial-and-error strategy.} trial-and-error strategy.}
\item{...}{some unused parameters.}
} }
\value{ \value{
NULL. NULL.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment