# NOT RUN {
# Using the correlation matrix
library(metan)
cor_iris <- cor(iris[,1:4])
n <- nrow(iris)
col_diag <- colindiag(cor_iris, n = n)
# Using a data frame
col_diag_gen <- data_ge2 %>%
split_factors(GEN) %>%
colindiag()
# Diagnostic by levels of a factor selecting desired variables
col_diag_gen <- data_ge2 %>%
split_factors(GEN) %>%
colindiag(EH, PH, CD, CL)
# }
Run the code above in your browser using DataCamp Workspace