Prevents unwanted messages from being printed.

filter_messages(expr, pattern = "Took .* seconds", ...)

Arguments

expr

The function that produces the messages-

pattern

The (regex) pattern to identify the messages that shall be filtered.

...

Arguments passed on to base::grepl

x

a character vector where matches are sought, or an object which can be coerced by as.character to a character vector. Long vectors are supported.

ignore.case

if FALSE, the pattern matching is case sensitive and if TRUE, case is ignored during matching.

perl

logical. Should Perl-compatible regexps be used?

fixed

logical. If TRUE, pattern is a string to be matched as is. Overrides all conflicting arguments.

useBytes

logical. If TRUE the matching is done byte-by-byte rather than character-by-character. See ‘Details’.

Value

Passes the return of the expr call.

Details

If a function is too talkative, you can filter certain messages by a pattern. Only messages are filtered, not warnings or errors (or other printing methods).