Learn R Programming

scidb (version 1.2-0)

antijoin: antijoin

Description

Given two SciDB arrays of same dimensionality, return any coordinates that do NOT join.

Usage

antijoin( array1, array2 )

Arguments

array1
a scidb array or scidbdf data frame object.
array2
a scidb array or scidbdf data frame object.

Value

NULL is returned when the two arrays join in all coordinates. Otherwise, a scidb array is returned such that for all coordinates, the single attribute shall equal to 1 if those coordinates exist only in array1, or 2 if those coordinates exist only in array2.

See Also

scidb

Examples

Run this code
## Not run: 
# set.seed(1)
# # Generate sparse SciDB arrays
# a <- as.scidb(Matrix::sparseMatrix(
#                sample(10,100,replace=TRUE),sample(10,100,replace=TRUE),x=runif(100)))
# b <- as.scidb(Matrix::sparseMatrix(
#                sample(10,100,replace=TRUE),sample(10,100,replace=TRUE),x=runif(100)))
# antijoin(a,b)[]
# 
# # Output looks like:
# # [1,] 2 . . 1 2 1 . . . 2
# # [2,] 2 . 2 2 2 1 1 1 2 2
# # [3,] 2 . . 2 . 2 . . . 1
# # [4,] . 2 1 . . . . 1 . 2
# # [5,] . . . . . 1 . . . 2
# # [6,] 1 2 . . 2 2 . 1 . 2
# # [7,] . 1 . 1 . 1 . 1 . 1
# # [8,] 2 . 1 . 1 1 1 . . .
# # [9,] 2 . 1 . 2 . . 2 1 .
# #[10,] 2 . . . 2 . 2 2 . .
# ## End(Not run)

Run the code above in your browser using DataLab