Description Usage Arguments Value See Also Examples
This function will return a vector, with the same length as the number of rows of the provided data frame, corresponding to the number of missing values in each row
1 | num_row_NAs(data, allow.NaN = FALSE)
|
data |
A data frame |
allow.NaN |
Treat NaN like NA (by counting it). FALSE by default |
A vector of number of missing values in each row
1 2 3 4 5 6 7 8 9 10 11 | num_row_NAs(mtcars)
library(magrittr) # for piping operator
library(dplyr) # for "everything()" function
# using every column from mtcars, make sure there are at most
# 2 NAs in each row. If there are any more than two, error out
mtcars %>%
assert_rows(num_row_NAs, within_bounds(0,2), everything())
## anything here will run
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.