make.null: Drop or keep variables in a dataset

Description Usage Arguments Value Author(s) See Also Examples

View source: R/make.null.R

Description

Given a set of variable names (or integers), remove (or keep) these columns from a dataset

Usage

1
make.null(..., data, keep = FALSE)

Arguments

...

objects (either vectors of strings, vectors of numbers, or both)

data

the dataset you're trying to eliminate (or keep) variables from

keep

should the variables be kept (keep=T) or dropped (keep=F)?

Value

a dataset, containing the variables of interest only

Author(s)

Dustin Fife

See Also

subset.

get.cols, r

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data = data.frame(matrix(rnorm(100), ncol=5))
names(data) = LETTERS[1:5]

#### extract only the classification
data(iris)
new.data = make.null(c("Sepal.Length"), 
       r("Sepal.Width", "Petal.Width", names(iris)), data=iris)

#### extract all but the classification
new.data2 = make.null(c("Sepal.Length"), 
   r("Sepal.Width", "Petal.Width", names(iris)), data=iris, keep=TRUE)

fifer documentation built on May 30, 2017, 7:40 a.m.

Related to make.null in fifer...