keep: The Keep Function

Description Usage Arguments Details Author(s) See Also

Description

Modified from https://github.com/flor3652/myStuff/blob/master/R/keep.R. This function is designed to keep a given list of variables (as opposed to the rm function, which is designed to remove a list of variables). In addition to the original code, it also forces a gc() garbage collection.

Usage

1
keep(..., x = c())

Arguments

...

Variables that should stay in the environment

x

A character vector of variables which you wish to keep

Details

The function uses the ls command to find the variables that are defined in the global environment. It then deletes all variables that are not given as an argument.

Author(s)

Michael Floren

See Also

rm ls gc


MalteThodberg/coRe documentation built on May 8, 2019, 3:25 p.m.