# Extract the subject area from each document ID and use it as the grouping
# variable
micusp_biber$doc_id <- factor(substr(micusp_biber$doc_id, 1, 3))
m <- mda_loadings(micusp_biber, n_factors = 2)
attr(m, "group_means")
heatmap_mda(m)
Run the code above in your browser using DataLab