diff --git a/R/fetchSoilGrids.R b/R/fetchSoilGrids.R index 7aca4d5d..827d5c18 100644 --- a/R/fetchSoilGrids.R +++ b/R/fetchSoilGrids.R @@ -46,7 +46,7 @@ #' @param overwrite Only used when `grid=TRUE`. Default: `FALSE` #' @param target_resolution Only used when `grid=TRUE`. Default: `c(250, 250)` (250m x 250m pixels) #' @param summary_type Only used when `grid=TRUE`. One or more of `"Q0.05"`, `"Q0.5"`, `"Q0.95"`, `"mean"`; these are summary statistics that -#' corresponding to 5th, 50th and 95th percentiles and mean value for selected `variables`. +#' correspond to 5th, 50th, 95th percentiles, and mean value for selected `variables`. #' @param ... Additional arguments passed to `terra::writeRaster()` when `grid=TRUE`. #' @param verbose Print messages? Default: `FALSE` #' @param progress logical, give progress when iterating over multiple requests; Default: `FALSE` @@ -124,6 +124,7 @@ fetchSoilGrids <- function(x, return(.get_soilgrids(locations, filename = filename, overwrite = overwrite, + variables = variables, target_resolution = target_resolution, depth = depth_intervals, summary_type = summary_type, @@ -307,7 +308,7 @@ fetchSoilGrids <- function(x, stopifnot(requireNamespace("terra")) stopifnot(requireNamespace("sf")) - if (!all(substr(depth, nchar(depth) - 2, nchar(depth)) == "cm")) { + if (!all(substr(depth, nchar(depth) - 1, nchar(depth)) == "cm")) { depth <- paste0(depth, "cm") } diff --git a/man/fetchSoilGrids.Rd b/man/fetchSoilGrids.Rd index 27dd9377..c0033f13 100644 --- a/man/fetchSoilGrids.Rd +++ b/man/fetchSoilGrids.Rd @@ -38,7 +38,7 @@ fetchSoilGrids( \item{target_resolution}{Only used when \code{grid=TRUE}. Default: \code{c(250, 250)} (250m x 250m pixels)} \item{summary_type}{Only used when \code{grid=TRUE}. One or more of \code{"Q0.05"}, \code{"Q0.5"}, \code{"Q0.95"}, \code{"mean"}; these are summary statistics that -corresponding to 5th, 50th and 95th percentiles and mean value for selected \code{variables}.} +correspond to 5th, 50th, 95th percentiles, and mean value for selected \code{variables}.} \item{...}{Additional arguments passed to \code{terra::writeRaster()} when \code{grid=TRUE}.}