`exams2nops()` 中的多个图

Multiple Plots in `exams2nops()`

我尝试在使用 exams2nops() 的 R 考试中使用 (gg) 图使用多个问题。 但是,第一个图似乎也被缓存和显示,而不是所有其他图。

编辑: "more than one question" 我的意思是考试有几个问题,其中包含 每个人 的情节,每个人都有 人之间的随机差异。

R/exams 网页上提供的模板提供了几个示例,说明如何在练习中包含随机图形。具体例子见:http://www.R-exams.org/templates/scatterplot/.

这使用基础图形来生成散点图。如果你想使用 ggplot2 而不是你可以替换 "scatterplot" 块 plot(x, y),例如:

d <- data.frame(x = x, y = y)
library("ggplot2")
theme_set(theme_minimal())
ggplot(d, aes(x = x, y = y)) + geom_point()

两者都会产生所需的随机输出。