get_types {latentcor} | R Documentation |
Automatically determine types of each variable (continuous/binary/ternary/truncated) in a data matrix.
Description
Automatically determine types of each variable (continuous/binary/ternary/truncated) in a data matrix.
Usage
get_types(X, tru_prop = 0.05)
Arguments
X |
A numeric data matrix (n by p), where n is number of samples, and p is number of variables. Missing values (NA) are allowed. |
tru_prop |
A scalar between 0 and 1 indicating the minimal proportion of zeros that should be present in a variable to be treated as |
Value
get_types
returns
types: A vector of length p indicating the type of each of the p variables in
X
. Each element is one of"con"
(continuous),"bin"
(binary),"ter"
(ternary) or"tru"
(truncated).
Examples
X = gen_data(types = c("ter", "con"))$X
get_types(X)