View source: R/S03_Utilities.R
has_NA | R Documentation |
Identifies rows in a matrix or data frame that contain any (or all) NA values.
has_NA(x, any = TRUE)
x |
A matrix or data frame. |
any |
Logical; if |
A logical vector with values of
TRUE
for rows with any NA
values (or rows where all values are NA
when any = FALSE
).
x <- matrix(rnorm(9), 3, 3)
x[2, 3] <- NA
has_NA(x)
x <- data.frame(A = c(1, 2, NA), B = 0)
has_NA(x)
x <- matrix(rnorm(9), 3, 3)
x[2, ] <- NA
x[3, 1] <- NA
has_NA(x, any = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.