# 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 %>%
group_by(GEN) %>%
colindiag()
# Diagnostic by levels of a factor
# For variables with "N" in variable name
col_diag_gen <- data_ge2 %>%
group_by(GEN) %>%
colindiag(contains("N"))
# }
Run the code above in your browser using DataLab