is_equal: is equal

Description Usage Arguments Value Examples

View source: R/recode-with-table.R

Description

Function to compare even with NA present This function returns TRUE wherever elements are the same, including NA's, and false everywhere else.

Usage

1
is_equal(v1, v2)

Arguments

v1

variable 1

v2

variable 2

Value

boolean value of whether or not v1 and v2 are equal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(cchsflow)
is_equal(1,2)
# FALSE

is_equal(1,1)
# TRUE

1==NA
# NA

is_equal(1,NA)
# FALSE

NA==NA
# NA

is_equal(NA,NA)
# TRUE

cchsflow documentation built on June 24, 2021, 1:07 a.m.