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)