show_rows | R Documentation |
Keeps the rows you mention in the printed table.
Compared to dplyr::filter()
, show_rows does not remove the
rows from the actual data frame, they are removed only for printing.
show_rows(x, ...)
x |
condformat_tbl object |
... |
Expressions used for filtering |
A condformat_show_rows object, usually to be added to a condformat_tbl object as shown in the examples
dplyr::filter()
library(condformat)
data(iris)
x <- head(iris)
cf <- condformat(x) %>% show_rows(Sepal.Length > 4.5, Species == "setosa")
## Not run:
print(cf)
## End(Not run)
# Use it programatically
expr_as_text <- 'Sepal.Length > 4.5'
expr <- rlang::parse_expr(expr_as_text)
cf <- condformat(x) %>% show_rows(!! expr)
## Not run:
print(cf)
## End(Not run)
# With multiple arguments:
expr_as_text <- c('Sepal.Length > 4.5', 'Species == "setosa"')
exprs <- lapply(expr_as_text, rlang::parse_expr)
cf <- condformat(x) %>% show_rows(!!! exprs)
## Not run:
print(cf)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.