powered by
Filter data with user-specified expression
filter_data(dataset, filt = "", drop = TRUE)
Data frame to filter
Filter expression to apply to the specified dataset
Drop unused factor levels after filtering (default is TRUE)
Filtered data frame
Filters can be used to view a sample from a selected dataset. For example, runif(nrow(.)) > .9 could be used to sample approximately 10
# NOT RUN { select(diamonds, 1:3) %>% filter_data(filt = "price > max(.$price) - 100") select(diamonds, 1:3) %>% filter_data(filt = "runif(nrow(.)) > .995") # }
Run the code above in your browser using DataLab