Skip to contents

Filter observations and variables and directly view the result on screen.

Usage

where.(data_frame, condition = NULL, keep = NULL)

Arguments

data_frame

A data frame on which to apply filters.

condition

The condition on which to filter observations.

keep

The Variables to keep in the result data frame.

Value

Returns a filtered data frame.

See also

The following functions can make use of the do_if() filter variables:

Conditions: if.(), else_if.(), else.()

Filter Data Frame: where.()

Create new Variables: compute()

Examples

# Example data frame
my_data <- dummy_data(1000)

# Get a quick filtered view
my_data |> where.(sex == 1 & age < 25,
                  c(sex, age, household_id, education))