我想在我的kable表格中包裝長文本。以下是列表文本的一個簡單示例,其中列文本太長,需要將表格打包以適合頁面。在kable表格列中包裝長文本
---
title: "test"
output: pdf_document
---
```{r setup, include=FALSE}
library(knitr)
```
This is my test
```{r test, echo=FALSE}
test <- data.frame(v1=c("This is a long string. This is a long string. This is a long string. This is a long string. This is a long string.",
"This is a another long string. This is a another long string. This is a another long string. This is a another long string. This is a another long string."),
v2=c(1, 2))
kable(test)
```
看起來很漂亮,@達羅齊格。有沒有列名稱的參數?對不起,如果我錯過了。 – 2015-04-03 04:11:15
謝謝@EricGreen。你錯過了什麼名字?可能你最好將它們設置在'data.frame'級別。 – daroczig 2015-04-03 04:15:32
'kable'有'col.names'來重新定義「我的文本」 – 2015-04-03 04:16:48