Description Usage Arguments Value Examples
View source: R/data.table_misc.R
Prints count(s) of missing values (coded as NA
) in an object
(vector
, data.frame
, data.table
etc.).
1 |
prop |
Flag indicating if results should include proportions. |
print |
Flag indicating if results should be printed. |
data |
Input object. |
Table with counts (and proportions if TRUE) of missing values.
1 2 3 4 5 6 7 8 9 10 | dt <- data.table::data.table(a = rnorm(n=1000, mean=20, sd=5),
b = rnorm(n=1000, mean=20, sd=5),
c = rnorm(n=1000, mean=20, sd=5))
dt[sample.int(nrow(dt), round(nrow(dt) * 0.15)), a := NA_real_]
count_NAs(dt)
count_NAs(dt, prop = TRUE)
count_NAs(dt[, a])
count_NAs(dt[, a], prop = TRUE)
count_NAs(dt[, .(a)])
count_NAs(dt[, .(a)], prop = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.