keepr: keeps a specified list of variables and drops the rest

View source: R/keepr.R

keeprR Documentation

keeps a specified list of variables and drops the rest

Description

keepr is used to keep a list of variables in a dataframe (and to drop the rest). Inspired by the "keep" command in Stata.

Usage

keepr(mydf, ...)

Arguments

mydf

the dataframe to be modified.

...

a list of the variables to be kept.

Details

keepr is used internally by the fsm package.

Examples

mydf <- mtcars
mydf <- keepr(mydf, "mpg", "cyl", "displ")
mydf


alexmitrani/humblr documentation built on April 4, 2022, 8:29 a.m.