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 ✔
**Note de version**
* MAJ de map_so_ii
* MAJ de add_bar
* MAJ de add_inset
* MAJ de map_so_ii
**Détails**
* map_so_ii ajustement de l'appel de add_bar pour permettre de définir
directement depuis l'appel les paramètres de add_bar
* add_bar: changement des noms des paramètres pour plus de clarté dans appel
dans map_so_ii
* add_bar: correction bug, ajout de "..." comme paramètre
* add_inset: suppression de warnings pour st_centroid
* map_so_ii: suppression de message pour st_union du scope
# 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
Package: so.ii
Title: Utilities very useful to share within so_ii team
Version: 1.0.28.0
Version: 1.0.28.1
Authors@R:
c(
person(given = "Frédéric",
......
......@@ -9,6 +9,7 @@
#' @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
#' trial-and-error strategy.
#' @param ... some unused parameters.
#'
#' @return NULL.
#'
......@@ -29,7 +30,8 @@ add_bar = function(
bar_d = NULL,
bar_xy = NULL,
bar_adj = NULL,
bar_lon = 0.4788987
bar_lon = 0.4788987,
...
) {
d = adjust_terra_scale(bar_d)
xy = calculate_terra_xy(bar_xy)
......
......@@ -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("ymin", "ymax")]) / diff(ext_x[c("ymin", "ymax")])
))
centroid = sf::st_centroid(x)
centroid = suppressWarnings(sf::st_centroid(x))
x = (x - centroid) * ratio
ext_x = sf::st_bbox(x)
ratio_real = stats::setNames(c(
......
......@@ -240,10 +240,12 @@ map_so_ii = function(
warnings("Nothing pertinent found in scope, default value is used.")
scope = so.ii::so_ii_limit
} else {
scope = sf::st_union(
so.ii::so_ii_collectivity[
so.ii::so_ii_collectivity[["commune"]] %in% scope,
]
scope = suppressMessages(
sf::st_union(
so.ii::so_ii_collectivity[
so.ii::so_ii_collectivity[["commune"]] %in% scope,
]
)
)
}
}
......
......@@ -5,7 +5,7 @@
\alias{add_bar}
\title{Add a bar to a map}
\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{
\item{bar_d}{integer, size of the bar in km.}
......@@ -17,6 +17,8 @@ the plot.}
\item{bar_lon}{numeric of length 1, may be adjusted for some plots with
trial-and-error strategy.}
\item{...}{some unused parameters.}
}
\value{
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