Description Usage Arguments Value Examples
View source: R/data.table_misc.R
Prints count(s) of specified values in a data.table
object.
1 2 | count_values(dt_in, value = "", prop = FALSE, na.rm = TRUE,
print = TRUE)
|
print |
Table with counts (and proportions if TRUE) of specified 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 := -Inf]
count_values(dt)
count_values(dt, prop = TRUE)
count_values(dt, -Inf)
count_values(dt, -Inf, prop = TRUE)
TODO: Write tests
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.