filter_count | R Documentation |
Count observations dropped from data.table by running expr and save as attribute
filter_count(dt, fields, key_name, expr)
dt |
data.table to transform and summarize |
fields |
string or vector of strings, sets of fields to summarize the observations by. Use "-" between column names to summarize by multiple fields. Use a single "*" to return the unconditional number of rows of the data.table |
key_name |
string list key to save the statistics under, in the "log" attribute of the data.table |
expr |
input data.table after transform from expr
iris_dt <- as.data.table(iris) iris_dt <- filter_count(iris_dt, c("*", "Species", "Species-Petal.Width"), "setosa-only", { iris_dt[Species == "setosa"] }) attr(iris_dt, "log")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.