Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试生成一个排序表并导出到乳胶。但是,似乎 xtable 无法处理排序表。建议?
a<-sample(letters,500,replace=T) b<-table(a) c<-sort(table(a),decreasing=T) xtable(b) xtable(c)
//M
很简单: sort() 不返回一个表,而是一个数组。使用 as.table() 解决您的问题:
a<-sample(letters,500,replace=T) b<-table(a) class(b) c<-sort(table(a),decreasing=T) class(c) d <- as.table(c) class(d) xtable(d)