Skip to content

Commit

Permalink
read_VECT(), write_VECT(): set the ignore.stderr default in function()
Browse files Browse the repository at this point in the history
  • Loading branch information
florisvdh committed Jun 15, 2024
1 parent ff0831f commit 7bc6744
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions R/vect_link_ng.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
#
read_VECT <- function(
vname, layer, type = NULL, flags = "overwrite",
ignore.stderr = NULL) {
ignore.stderr = get.ignore.stderrOption()) {
if (!(requireNamespace("terra", quietly = TRUE))) {
stop("terra required for SpatVector output")
}
if (is.null(ignore.stderr)) {
ignore.stderr <- get.ignore.stderrOption()
}
stopifnot(is.logical(ignore.stderr), !is.na(ignore.stderr))
if (missing(layer)) layer <- "1"
layer <- as.character(layer)
Expand Down Expand Up @@ -40,13 +37,11 @@ read_VECT <- function(
res
}

write_VECT <- function(x, vname, flags = "overwrite", ignore.stderr = NULL) {
write_VECT <- function(x, vname, flags = "overwrite",
ignore.stderr = get.ignore.stderrOption()) {
if (!(requireNamespace("terra", quietly = TRUE))) {
stop("terra required for SpatVector input")
}
if (is.null(ignore.stderr)) {
ignore.stderr <- get.ignore.stderrOption()
}
stopifnot(is.logical(ignore.stderr))
if (get.suppressEchoCmdInFuncOption()) {
inEchoCmd <- set.echoCmdOption(FALSE)
Expand Down

0 comments on commit 7bc6744

Please sign in to comment.