inspect_map {cleandata} | R Documentation |
Classify The Columns of A Data Frame
Description
Provide a map for imputation and encoding.
Usage
inspect_map(x, common = 0, message = TRUE)
Arguments
x |
The data frame |
common |
a non-negative numerical parameter, if 2 factorial columns share more than 'common' levels, they share the same scheme. 0 means all the levels should be the same for 2 factorial columns to share the same scheme. |
message |
Whether print the process. |
Value
A list of factor_cols
(list), factor_levels
(list), num_cols
(vector), char_cols
(vector), ordered_cols
(vector), and other_cols
(vector).
factor_cols |
a list, in which each member is a vector of the names of the factorial columns that share the same scheme. The name of a vector is the same as its 1st member. Refer to the argument |
factor_levels |
a list, in which each member is a scheme of the factorial columns. The name of a scheme is the same as its corresponding vector in |
num_cols |
a vector, in which are the names of the numerical columns. |
char_cols |
a vector, in which are the names of the string columns. |
ordered_cols |
a vector, in which are the names of the ordered factorial columns. |
other_cols |
a vector, in which are the names of the other columns. |
See Also
Examples
# building a data frame
A <- as.factor(c('x', 'y', 'z'))
B <- as.ordered(c('z', 'x', 'y'))
C <- as.factor(c('y', 'z', 'x'))
D <- as.factor(c('i', 'j', 'k'))
E <- 5:7
df <- data.frame(A, B, C, D, E)
# inspection
dmap <- inspect_map(df)
summary(dmap)
print(dmap)