Skip to content

Commit

Permalink
Safer check for NAs in tiledb_config()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mojaveazure committed Feb 13, 2023
1 parent 49d66f4 commit d1cc7ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/Config.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d1cc7ae

Please sign in to comment.