gridExtra パッケージ内で grid.table を使用して、調査コメントのリストを表形式で表示しています。コメント(文字列変数)が一定の長さを超えると、自動的に改行「\n」を挿入したい。
library(gridExtra)
df<-data.frame(comments = c("Here is a short string",
"Here is a long string that needs to be broken in half so that it doesn't run off the page",
"Here is another short string"))
grid.newpage()
print(grid.table(df$comments))
この機能が他の場所で利用できる場合は、別のテーブル パッケージを使用することにオープンです。