簡體   English   中英

針織 PDF Output 與 CAT in R

[英]Knit PDF Output with CAT in R

我在 R 中使用 CAT 命令來關注 output。

編織的 PDF 文件中的 Output 與我在控制台中得到的不同。 如何在控制台中獲得類似 output 中的 PDF?

在 PDF Output 中,打印問題和代碼 output 混合在一起。

header <- blue$italic

cat(header("\nAre there any Missing Values ? \n"))
anyNA(cars_df)

cat(header("\nHow many Missing Values are there ? \n"))
sum(is.na(cars_df))

cat(header("\nWhich Variables have got Missing Values ? \n"))
colSums(is.na(cars_df))

R 工作室控制台 Output

R Studio 控制台輸出

針織PDF Output

針織 PDF 輸出

我有同樣的問題,但 html:

這個>

在此處輸入圖像描述

結果導致這個丑陋的混亂>

在此處輸入圖像描述

解決方案 1 是使用“hold”而不是“asis”:=> 在此處輸入圖像描述 在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM