From 8a1b0793031a1a2f3ca3efd7b69c8eddf33493e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurycy=20=C5=BBarczy=C5=84ski?= <63068977+mzarowka@users.noreply.github.com> Date: Wed, 4 Sep 2024 19:13:37 +0200 Subject: [PATCH] Fix argument name in stretch_raster... --- R/plotting.R | 8 ++++++-- man/stretch_raster_full.Rd | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/R/plotting.R b/R/plotting.R index d5d3462..80feeef 100644 --- a/R/plotting.R +++ b/R/plotting.R @@ -2,13 +2,13 @@ #' #' @family Plotting #' @param raster a SpatRaster, preferably reflectance file. -#' @param ext character, a graphic format extension. +#' @param extension character, a graphic format extension, defaults to "tif". #' @param write logical, should resulting SpatRaster be written to file. #' #' @export stretch_raster_full <- function( raster, - ext = NULL, + extension = NULL, write = TRUE) { # Check if correct class is supplied. @@ -28,7 +28,11 @@ stretch_raster_full <- function( fs::path_ext_remove() # Prepare name + if (is.null(filename) == TRUE) { + filename <- paste0(raster_src, "/RGB_", raster_name, ".tif") + } else { filename <- paste0(raster_src, "/RGB_", raster_name, ".", ext) + } # Check if there are values close to RGB, within the 25 nm. if (all(any(purrr::list_c(purrr::map(c(450, 550, 650), \(i) dplyr::near(i, as.numeric(names(raster)), tol = 25))))) == TRUE) { diff --git a/man/stretch_raster_full.Rd b/man/stretch_raster_full.Rd index 7a26910..cf2ff0e 100644 --- a/man/stretch_raster_full.Rd +++ b/man/stretch_raster_full.Rd @@ -4,12 +4,12 @@ \alias{stretch_raster_full} \title{Stretch and optionally save full RGB preview of SpatRaster} \usage{ -stretch_raster_full(raster, ext = NULL, write = TRUE) +stretch_raster_full(raster, extension = NULL, write = TRUE) } \arguments{ \item{raster}{a SpatRaster, preferably reflectance file.} -\item{ext}{character, a graphic format extension.} +\item{extension}{character, a graphic format extension, defaults to "tif".} \item{write}{logical, should resulting SpatRaster be written to file.} }