hush: Sometimes you just need a little peace and quiet.

View source: R/hush.R

hushR Documentation

Sometimes you just need a little peace and quiet.

Description

This uses sink() to silence unwanted output from R code. So far it seems to be more successful than invisible(). I basically followed the Stack Overflow discussion in the references to create this one.

Usage

hush(code, is_unix = FALSE)

Arguments

code

R code that you want to silence.

is_unix

Logical; Default is FALSE, but if you are working in a UNIX environment then you will want to set it to TRUE.

Value

The output of your code, but without printing to console.

References

https://stackoverflow.com/questions/2723034/suppress-one-commands-output-in-r

Examples

x <- dput(names(mtcars))
x <- hush(dput(names(mtcars)))
x

emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.