Skip to contents

Stop Function Exectution With Formatted Message

Usage

stopFormatted(x, ..., call. = FALSE)

Arguments

x

Error message, possibly containing percentage placeholders, passed as argument fmt to sprintf

...

as many values as referenced with percentage placeholders in the error message

call.

logical, indicating if the call should become part of the error message.

Examples

try(stopFormatted(
  "Hi, %s, the program fails for the %d-th time.", "Dexter", 1000
))
#> Error : Hi, Dexter, the program fails for the 1000-th time.