我不确定这是 R 问题还是 Sweave 问题。我在一个简单的表格(3 年级和 6 年级)中查看学生的 2 个时间点的分数。我创建了表格并打印出来,但是我想添加标签,以便人们知道哪个分数来自哪个年级。
我的 Sweave 代码是:
<<MakeData,results='asis'>>=
library(xtable)
Grade3 <- c("A","B","B","A","B","C","C","D","A","B","C","C","C","D","B","B","D","C","C","D")
Grade6 <- c("A","A","A","B","B","B","B","B","C","C","A","C","C","C","D","D","D","D","D","D")
Cohort <- table(Grade3,Grade6)
print(xtable(Cohort))
@
我得到一个很好的计数表,但是行和列都有相同的符号。如何添加标签以使其更清晰?