extractVariable: Extract variables according to mode from data.frame.

Description Usage Arguments Value Examples

View source: R/extractVariable.R

Description

This function extract variables which match specified mode from data.frame, and make a new data frame.

Usage

1
extractVariable(data = NULL, mode = "numeric")

Arguments

data

a data.frame from which numeric variables are extracted.

mode

a character specifying object type. Object modes of ‘numeric’, ‘character’, ‘factor’, and ‘logical’ are supported.

Value

a data.frame which includes only specified mode of variables.

Examples

1
2
3
4
df <- data.frame(id=seq(1,10), str=letters[1:10], fac=factor(seq(1,10)), stringsAsFactors=FALSE)
extractVariable(df)
extractVariable(df, mode="character")
extractVariable(df, mode="factor")

epifit documentation built on May 29, 2017, 3:43 p.m.