Commit 56473b4a authored by Grelot Frederic's avatar Grelot Frederic :swimmer_tone5:
Browse files

geau Version 1.0.13.0

0 errors :heavy_check_mark: | 0 warnings :heavy_check_mark: | 0 notes :heavy_check_mark:

- map_so_ii
	- passage à cairo_pdf pour les pdf, car pdf ne gère pas utf-8
	- ajout de device svg
Showing with 28 additions and 5 deletions
+28 -5
Package: geau Package: geau
Title: Utilities very useful to share within geau-inondation team Title: Utilities very useful to share within geau-inondation team
Version: 1.0.12.0 Version: 1.0.13.0
Authors@R: Authors@R:
c( c(
person(given = "Frédéric", person(given = "Frédéric",
......
...@@ -60,7 +60,17 @@ ...@@ -60,7 +60,17 @@
#' years is plotted.} #' years is plotted.}
#' } #' }
#' } #' }
#' #' \subsection{path specification}{
#' Depending on the extension a device is chosen.
#' \itemize{
#' \item{\strong{pdf}: grDevices::cairo_pdf}
#' \item{\strong{png}: grDevices::png}
#' \item{\strong{svg}: grDevices::svg}
#' }
#' If path is NULL, standard plotting is used. If an extension is not managed,
#' an error is raised.
#' }
#'
#' @param dataset sf objectf, data to be plotted #' @param dataset sf objectf, data to be plotted
#' @param dataset_legend list of parameters to be passed to legend #' @param dataset_legend list of parameters to be passed to legend
#' @param theme character, choice for the theme (if any). See details. #' @param theme character, choice for the theme (if any). See details.
...@@ -68,7 +78,8 @@ ...@@ -68,7 +78,8 @@
#' @param detail character, detail for theme, depends on theme. See details. #' @param detail character, detail for theme, depends on theme. See details.
#' @param year character, the year chosen for some themes. See details. #' @param year character, the year chosen for some themes. See details.
#' @param bar logical, should a bar be plotted for the dataset #' @param bar logical, should a bar be plotted for the dataset
#' @param path character, the name of the file to save the plot #' @param path character, the name of the file to save the plot. Graphical
#' device is chosen depending on extension. See details.
#' @param ... some parameters that will be used by plot (from sf) #' @param ... some parameters that will be used by plot (from sf)
#' #'
#' @return Nothing useful. #' @return Nothing useful.
...@@ -101,8 +112,9 @@ map_so_ii = function( ...@@ -101,8 +112,9 @@ map_so_ii = function(
if (!is.null(path)) { if (!is.null(path)) {
switch( switch(
EXPR = tolower(tools::file_ext(path)), EXPR = tolower(tools::file_ext(path)),
"pdf" = grDevices::pdf(path), "pdf" = grDevices::cairo_pdf(path),
"png" = grDevices::png(path), "png" = grDevices::png(path),
"svg" = grDevices::svg(path),
stop(sprintf("%s not recognized", tolower(tools::file_ext(path)))) stop(sprintf("%s not recognized", tolower(tools::file_ext(path))))
) )
on.exit(grDevices::dev.off()) on.exit(grDevices::dev.off())
......
...@@ -33,7 +33,8 @@ map_so_ii( ...@@ -33,7 +33,8 @@ map_so_ii(
\item{bar}{logical, should a bar be plotted for the dataset} \item{bar}{logical, should a bar be plotted for the dataset}
\item{path}{character, the name of the file to save the plot} \item{path}{character, the name of the file to save the plot. Graphical
device is chosen depending on extension. See details.}
\item{...}{some parameters that will be used by plot (from sf)} \item{...}{some parameters that will be used by plot (from sf)}
} }
...@@ -103,6 +104,16 @@ provided an analysis of the evolution between the range of given ...@@ -103,6 +104,16 @@ provided an analysis of the evolution between the range of given
years is plotted.} years is plotted.}
} }
} }
\subsection{path specification}{
Depending on the extension a device is chosen.
\itemize{
\item{\strong{pdf}: grDevices::cairo_pdf}
\item{\strong{png}: grDevices::png}
\item{\strong{svg}: grDevices::svg}
}
If path is NULL, standard plotting is used. If an extension is not managed,
an error is raised.
}
} }
\examples{ \examples{
......
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