## Single subject -------------------------------------------------
#### the distance from a person to all items/item clusters
dist_z_w <- c(item1 = 1.6, item2 = 0.8, item3 = 1.9, item4 = 2.5, item5 = 0.4)
#### transform distance to strength
strength <- exp(-dist_z_w)
#### plot the radar
radarplot(strength, labels = names(strength),
overallAbility = 1.8, showOverallAbility = TRUE,
title = "Student A profile")
## Multiple subjects ---------------------------------------------
set.seed(1)
#### strength for 3 persons on 5 items
dat <- matrix(rnorm(15, 3, 1), nrow = 3,
dimnames = list(NULL, c("item1", "item2", "item3", "item4", "item5")))
radarplot(dat, labels = colnames(dat),
overallAbility = c(-1.8, 0.5, 2.5),
subjectLabels = c("Alice", "Bob", "Cara"),
sampleColors = c("#1b9e77", "#d95f02", "#7570b3"),
showOverallAbility = TRUE,
title = "Class-level comparison")
Run the code above in your browser using DataLab