Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

data(parkinson)
Detect(parkinson)
data(spect)
Detect(spect)
data(tic)
table(Detect(tic))

imputeR

A General Multivariate Imputation Framework

v2.2
GPL-3
Authors
Steffen Moritz [aut, cre] (<https://orcid.org/0000-0002-0085-1804>), Lingbing Feng [aut], Gen Nowak [ctb], Alan. H. Welsh [ctb], Terry. J. O'Neill [ctb]
Initial release
2020-01-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.