From 52a5aefc0d1a667cd75d1f8a1823acc9a07027de Mon Sep 17 00:00:00 2001 From: "Eric R. Scott" Date: Thu, 14 Mar 2024 15:50:45 -0700 Subject: [PATCH] Update R/tar-terra-vect.R Co-authored-by: Nicholas Tierney --- R/tar-terra-vect.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/R/tar-terra-vect.R b/R/tar-terra-vect.R index 688ba72..dc08bd3 100644 --- a/R/tar-terra-vect.R +++ b/R/tar-terra-vect.R @@ -114,12 +114,12 @@ tar_terra_vect <- function(name, gdal <- "ENCODING=UTF-8" } - if (filetype == "ESRI Shapefile") { - #special handling of ESRI shapefiles because the output is a dir of multiple files. - format <- create_format_terra_vect_shz(options = gdal, ...) - } else { - format <- create_format_terra_vect(filetype, options = gdal, ...) - } +format <- ifelse( + test = filetype == "ESRI Shapefile", + #special handling of ESRI shapefiles because the output is a dir of multiple files. + yes = create_format_terra_vect_shz(options = gdal, ...), + no = create_format_terra_vect(filetype, options = gdal, ...) +) targets::tar_target_raw( name = name,