which.class {formula.tools} | R Documentation |
These functions are used to identify variables types whether they are categorical or contibuus.
is.cat(x, classes = c('character', 'factor', 'logical') ) is.cont( x, classes = c( 'numeric', 'integer', 'Date' ) ) which.cat(x, ..., names = FALSE ) which.cont(x, ..., names = FALSE )
x |
an object such as a vector or data.frame |
classes |
a character vector of class names |
names |
logical. Whether to return names or indices |
... |
Arguments passed to other functions |
These functions are used to identify which/if a variable or variables are categorical or continuos.
is.cat
and is.cont
take single variable arguments.
which.cat
and which.cont
take a list or data.frame or any
structures whose elements have a class method.
For is.cat
and cont
a logical vector.
For which.cat
and which.cont
a vector of indices or a vector
of names.
Christopher Brown
is.cat( factor( "a", "b", "c" ) ) is.cat( c( "A", "B", "C" ) ) is.cat( c( TRUE, TRUE, FALSE ) ) is.cont( 1:10 ) is.cont( seq( 0, 1, .1 ) ) data(iris) which.cat( iris ) which.cat( iris, names = TRUE ) which.cont( iris ) which.cont( iris, names = TRUE )