From d1cc7ae07cfd016b826af6697f8ec8204101ea74 Mon Sep 17 00:00:00 2001 From: Paul Hoffman Date: Mon, 13 Feb 2023 17:46:59 -0500 Subject: [PATCH] Safer check for NAs in `tiledb_config()` Replace `if(is.na())` as R 4.2 errors when conditions > 1L Instead, removes NAs from `config` Then, checks the length of `config`; if there is a length, adds it to the TileDB config fixes #518 --- R/Config.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/Config.R b/R/Config.R index 6f6a819ba8..407dd798b3 100644 --- a/R/Config.R +++ b/R/Config.R @@ -55,7 +55,8 @@ tiledb_config.from_ptr <- function(ptr) { #' @importFrom methods new #' @export tiledb_config tiledb_config <- function(config = NA_character_) { - if (!is.na(config)) { + config <- config[!is.na(x = config)] + if (length(x = config)) { stopifnot(`If given, the 'config' argument must be a name, value character vector` = is.character(config) && !is.null(names(config))) ptr <- libtiledb_config(config) } else {