suppress_warning: Suppress Specific Warnings

Description Usage Arguments Details Value Author(s) Examples

View source: R/warnings.R

Description

Suppress certain warnings issued by an expression.

Usage

1

Arguments

expr

Expression to be executed

regexpr

Regular expression matching warnings to suppress

Details

All warnings which are issued by the expression and match the regular expression are suppressed.

Value

Return value of the expression

Author(s)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(dplyr, warn.conflicts = FALSE)
library(admiral.test)
data(adsl)
data(vs)

# Remove label
attr(vs$USUBJID, "label") <- NULL

left_join(adsl, vs, by = "USUBJID")

suppress_warning(
  left_join(adsl, vs, by = "USUBJID"),
  "^Column `USUBJID` has different attributes on LHS and RHS of join$"
)

epijim/admiral documentation built on Feb. 13, 2022, 12:15 a.m.