![](/img/trans.png)
[英]R: remove hidden line break characters from text strings within a data frame
[英]R: Manual line break within strings for HTML table output
我正在使用huxtable
R中的表復制為HTML輸出, huxtable
一個我無法回答的基本問題:是否有一種簡單的方法可以在字符串中添加換行符?
例:
[1] State with highest mortality rate compared to Population Population Deaths
[2] Alabama 16,000,000 15
[3] Alaska 3,000,000 7
...
我想手動中斷行,因為它是一個復制項目。
可能的最終結果:
[1] State with highest
mortality rate compared
to Population Population Deaths
[2] Alabama 16,000,000 15
[3] Alaska 3,000,000 7
...
讓我知道,如果有人找到了一個好的解決方案。 預先感謝您的幫助和分享!
使用<br>
在HTML中添加分隔符,並將相關單元格的escape_contents
設置為FALSE
。
myhux[1, 1] <- "State with highest<br> mortality rate compared <br> to population"
escape_contents(myhux)[1, 1] <- FALSE
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.