View source: R/data_management.R
equal | R Documentation |
test equality of two vectors without leaving NA as output (aka considering NA = NA are equal, so TRUE, and value = NA are diverse, so FALSE)
equal(x, y, one_NA = FALSE, both_NA = TRUE)
x |
first vector |
y |
second vector |
one_NA |
what to output if only one of the two provided is NA (default = TRUE, aka value are diverse) |
both_NA |
what to output if only one of the two provided is NA (default = TRUE, aka value are diverse) |
a <- c(NA, NA, 1, 2)
b <- c(1, NA, 2, 2)
equal(a, b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.