Learn R Programming

imputeR (version 2.2)

Detect: Detect variable type in a data matrix

Description

This function detects the type of the variables in a data matrix. Types can be continuous only, categorical only or mixed type. The rule for defining a variable as a categorical variable is when: (1) it is a character vector, (2) it contains no more than n = 5 unique values

Usage

Detect(x, n = 5)

Arguments

x

is the data matrix that need to be detected.

n

is a number, indicating how many levels, if outnumbered, can be seen as an numeric variable, rather than a categorical variable.

Value

the variable type for every column, can either be "numeric" or "character".

Examples

Run this code
# NOT RUN {
data(parkinson)
Detect(parkinson)
data(spect)
Detect(spect)
data(tic)
table(Detect(tic))
# }

Run the code above in your browser using DataLab