filter.: Filter rows on one or more conditions

Description Usage Arguments Examples

View source: R/filter.R

Description

Filters a dataset to choose rows where conditions are true.

Usage

1
filter.(.df, ..., .by = NULL)

Arguments

.df

A data.frame or data.table

...

Conditions to filter by

.by

Columns to group by if filtering with a summary function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
test_df <- tidytable(
  a = 1:3,
  b = 4:6,
  c = c("a","a","b")
)

test_df %>%
  filter.(a >= 2, b >= 4)

test_df %>%
  filter.(b <= mean(b), .by = c)

mtfairbanks/gdt documentation built on May 4, 2021, 9:44 a.m.