Efficiently check for existence of an array in SciDB using SciDB-R


#1

How to efficiently check for existence of an array arrayName in SciDB using SciDB-R?

Just running project(list(), name = arrayName) will not do when you start working with SciDB namespaces. For example, NAMESPACE1.arrayName does not show up on list() command.

Here is a solution using SciDBR.

scidb_exists_array = function(arrayName) {
  !is.null(
    tryCatch({
       iquery(paste("show(", arrayName, ")", sep=""), return=TRUE, binary = FALSE)
      }, error = function(e) {NULL}))
}

Open to suggestions for improvement.