unused_dots_warning: An error handler for 'rlang::check_dots_used()' that issues a...

View source: R/misc.utilities.R

unused_dots_warningR Documentation

An error handler for rlang::check_dots_used() that issues a warning that only lists argument names.

Description

This handler parses the error message produced by rlang::check_dots_used(), extracting the names of the unused arguments, and formats them into a more gentle warning message. It relies on rlang maintaining its current format.

Usage

unused_dots_warning(e)

Arguments

e

a condition object, typically not passed by the end-user; see example below.

Examples




g <- function(b=NULL, ...){
  invisible(force(b))
}

f <- function(...){
  rlang::check_dots_used(error = unused_dots_warning)
  g(...)
}

f() # OK
f(b=2) # OK
f(a=1, b=2, c=3) # Warning about a and c but not about b



statnet.common documentation built on Oct. 6, 2024, 5:06 p.m.