varType: varType

View source: R/reptools.r

varTypeR Documentation

varType

Description

Determine Types of Variables

Usage

varType(data, include = NULL, exclude = NULL, ndistinct = 10, nnonnum = 20)

Arguments

data

data frame or table to analyze

include

formula or vector of variable names to attend to

exclude

a formula or character vector specifying which variables to exclude from consideration

ndistinct

minimum number of distinct numeric values a variable must have to be considered continuous

nnonnum

maximum number of distinct values a variable can have to be considered discrete

Details

For all the variables in a data frame/table, analyzes them to determine types: continuous, nonnumeric, and discrete. include and exclude can be vector or right-side-only formulas.

Value

list of vectors

Author(s)

Frank Harrell

Examples

set.seed(1)
d <- data.frame(i=1:100, x=runif(100), y=sample(1:3, 100, TRUE),
                w=sample(c('cat','dog','giraffe'), 100, TRUE),
                v=sample(letters, 100, TRUE))
varType(d)

qreport documentation built on May 29, 2024, 3:51 a.m.