簡體   English   中英

在R中將表格打印到新窗口

[英]Print a table to new window in R

在R中,plot()在R中打開一個新窗口並顯示圖形。

有沒有辦法用表格做同樣的事情-不用打印到命令行?

我不是說print(),head()或sink()到文件。

這將很有用,因為可以將表轉移到單獨的窗口而不會弄亂控制台。

vprint <- function(x, ...) {
  require(htmltools)
  html_print(pre(paste0(capture.output(print(x, ...)), collapse="\n")))
}

vcat <- function(...) {
  require(htmltools)
  html_print(pre(paste0(capture.output(cat(...)), collapse="\n")))
}

vprint(mtcars)

vcat(str(mtcars))

可能的解決方案:

查看,修復,頁面,編輯

查看:僅查看數據框或矩陣
修復:您可以編輯數據(但不能撤消它!)
頁面:就像linux less命令
編輯:就像修復!
data.entry:就像修復!

暫無
暫無

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

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