keepif: keeps some rows in the dataset and drops the rest

Description Usage Arguments Value Examples

Description

keeps some rows in the dataset and drops the rest

Usage

1
keepif(x)

Arguments

x

a condition like: var1==2 in which case observations that satisfy the condition are kept and all others are removed.

Value

returns NULL, invisibly

Examples

1
2
3
use(cars, clear=TRUE)
keepif(speed <= 20)
listif()

genvar documentation built on Jan. 21, 2020, 9:07 a.m.