grapes-equals-grapes: T == NA -> F Operator

Description Usage Arguments Value Examples

Description

Replicates '==' behavior, but returns F instead of NA when making comparisons of <exists> == NA. NA == NA still returns missing when comparing equal length vectors.

Left and Right sides must be same length, or one of them length 1.

Equal length vectors will return vector of point-wise comparisons between the two

If left or right is length 1, it compares it to the entire other vector, returning a vector of logicals comparing to each place.

Usage

1
left %==% right

Arguments

left

Left side of operator

right

right side of operator

Value

vector of logicals

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
colors = c("red","blue")
Col_Samp1 = sample(c(colors,NA), size = 10, replace = T, prob = c(.5,.2,.3))
Col_Samp2 = sample(c(colors,NA), size = 10, replace = T, prob = c(.5,.2,.3))

View(t(rbind(Col_Samp1,Col_Samp2,
       Col_Samp1  ==  Col_Samp2,
       Col_Samp1 %==% Col_Samp2)))

View(t(rbind(Col_Samp1,Col_Samp2,
       'red'  ==  Col_Samp1,
       'red' %==% Col_Samp1)))

T  ==  NA
T %==% NA

NA  ==  NA
NA %==% NA

Ajfrick/AVRCHelp documentation built on May 28, 2019, 1:34 a.m.