% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utility_functions.R
\name{filter_messages}
\alias{filter_messages}
\title{Filter unwanted messages}
\usage{
filter_messages(expr, pattern = "Took .* seconds", ...)
}
\arguments{
\item{expr}{The function that produces the messages-}

\item{pattern}{The (regex) pattern to identify the messages that shall be filtered.}

\item{...}{
  Arguments passed on to \code{\link[base:grep]{base::grepl}}
  \describe{
    \item{\code{x}}{a character vector where matches are sought, or an
    object which can be coerced by \code{as.character} to a character
    vector.  \link[base]{Long vectors} are supported.}
    \item{\code{ignore.case}}{if \code{FALSE}, the pattern matching is \emph{case
      sensitive} and if \code{TRUE}, case is ignored during matching.}
    \item{\code{perl}}{logical.  Should Perl-compatible regexps be used?}
    \item{\code{fixed}}{logical.  If \code{TRUE}, \code{pattern} is a string to be
    matched as is.  Overrides all conflicting arguments.}
    \item{\code{useBytes}}{logical.  If \code{TRUE} the matching is done
    byte-by-byte rather than character-by-character.  See
    \sQuote{Details}.}
  }}
}
\value{
Passes the return of the \code{expr} call.
}
\description{
Prevents unwanted messages from being printed.
}
\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).
}
