简体   繁体   English

如何抑制R中的输出?

[英]How to suppress output in R?

I need to supress output in R language - same as in Matlab with semicolon. 我需要抑制R语言的输出-与带有分号的Matlab中的输出相同。

I found invisible() and sink() , but nothing works for me same way. 我发现了invisible()sink() ,但是没有任何一种对我有用。 Is it possible to do it? 有可能做到吗?

As suggested from Rui, can return output to a vector and remove that vector immediately: s <- capture.output(print(1:1000)); rm(s) 正如Rui所建议的,可以将输出返回到向量,并立即删除该向量: s <- capture.output(print(1:1000)); rm(s) s <- capture.output(print(1:1000)); rm(s)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM