filter_data | R Documentation |
Filter data with user-specified expression
filter_data(dataset, filt = "", drop = TRUE)
dataset |
Data frame to filter |
filt |
Filter expression to apply to the specified dataset |
drop |
Drop unused factor levels after filtering (default is TRUE) |
Filters can be used to view a sample from a selected dataset. For example, runif(nrow(.)) > .9 could be used to sample approximately 10
Filtered data frame
select(diamonds, 1:3) %>% filter_data(filt = "price > max(.$price) - 100")
select(diamonds, 1:3) %>% filter_data(filt = "runif(nrow(.)) > .995")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.