7

我正在为我的项目使用 RStudio,我想要一个单独的输出屏幕。我试过了sink(),但我需要一个新的弹出窗口。我的代码是

vd<-data.frame()
vd<-c("V1","V2")
vf<-length(vd)
i<-1
while(i<=vf){
vd<-c("V1","V2")
#print(vd)
leng<-length(vd)
selectru<-combn(vd,leng)
#print(selectru)
print(selectru[i])
fst<-selectru[i]
select<-data.frame()
select<-selectru[selectru[,1]!=selectru[i],]
m<-length(select)
select<-combn(select,m)
snd <-apply(select,2,function(rows) paste0(rows, collapse = ""))
cat(sprintf("\"%s\" =>\"%s\"\n", fst,snd))
i<-i+1
}

这些数据不是实际数据,只是示例数据。

是否可以在单独的屏幕或浏览器窗口中显示“仅”输出?无需显示任何图形或绘图操作。

4

1 回答 1

6

根据我的评论,这是一个使用ritesinkstart函数的示例。

代码:

library(rite)
sinkstart(echo=FALSE)
# your code
# close the widget with the X or
# use `sinkstop()` to turn off the `sink`ing

这是一个屏幕截图:

在此处输入图像描述

于 2014-01-19T09:08:11.133 回答