如何燮preSS输出 [英] How to suppress output

查看:162
本文介绍了如何燮preSS输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想燮preSS输出R中,当我从命令提示符下运行我的ř脚本。

I would like to suppress output in R when I run my R script from the command prompt.

我试过很多选项,包括 - 从 - 香草。这些选项减轻输出的文字量。

I tried numerous options including --slave and --vanilla. Those options lessens the amount of text outputted.

我也尝试管道输出到 NUL 但这并没有帮助。

I also tried to pipe the output to NUL but that didn't help.

推荐答案

看看帮助(汇)来做到这一点。在Unix上我会做

Look at help(sink) to do that. On Unix I'd do

sink("/dev/null")    # now suppresses
....                 # do stuff
sink()               # to undo prior suppression, back to normal now

和Windows当量(带尖的最帽子约翰内斯)是

and the Windows equivalent (with a tip-of-the-hat to Johannes) is

sink("NUL")
....
sink()

这篇关于如何燮preSS输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆