# Simulate and visualise a correlation matrix with 2 groups containing 5 and 10 members,
# correlations of 0.4 within groups and 0 between groups and rank equal to 4
cor_ls <- group_cor_mat(
n = c(5, 10),
within.cor = 0.4,
between.cor = 0,
rank = 4,
return.groups = TRUE
)
plot_matrix(
mat = cor_ls$cor.mat,
group.df = cor_ls$group.df,
order = TRUE
)
Run the code above in your browser using DataLab