Learn R Programming

broadcast (version 0.1.7)

bc.rel: Broadcasted General Relational Operators

Description

The bc.rel() function performs broadcasted general relational operations on 2 arrays.

Usage

bc.rel(x, y, op, ...)

# S4 method for ANY bc.rel(x, y, op)

Value

A logical array as a result of the broadcasted general relational operation.


Arguments

x, y

conformable vectors/arrays of any atomic type.

op

a single string, giving the relational operator.
Supported relational operators: ==, !=, <, >, <=, >=.

...

further arguments passed to or from methods.

See Also

broadcast_operators

Examples

Run this code

x.dim <- c(4:2)
x.len <- prod(x.dim)
x.data <- sample(c(NA, 1.1:1000.1), x.len, TRUE)
x <- array(x.data, x.dim)
y <- array(1:50, c(4,1,1))


bc.rel(x, y, "==")
bc.rel(x, y, "!=")
bc.rel(x, y, "<")
bc.rel(x, y, ">")
bc.rel(x, y, "<=")
bc.rel(x, y, ">=")

Run the code above in your browser using DataLab