Skip to contents

Redirects printed output of an expression to a file using sink().

Usage

sinking(expr, file)

Arguments

expr

An R expression to evaluate and capture output from.

file

A character string. File path to save the console output.

Value

None. The console output of expr is written to file.

Examples

if (FALSE) { # \dontrun{
sinking(summary(cars), "summary.txt")
} # }