Learn R Programming

W4MRUtils (version 1.0.0)

stopaste0: stopaste0 - to paste string to a message and stop

Description

stopaste calls paste0 of its parameters to build the error message and stops with the given message

Usage

stopaste0(...)

Arguments

...

Arguments passed on to base::paste0

collapse

an optional character string to separate the results. Not NA_character_.

recycle0

logical indicating if zero-length character arguments should lead to the zero-length character(0) after the sep-phase (which turns into "" in the collapse-phase, i.e., when collapse is not NULL).

Author

L.Pavot

Examples

Run this code

tryCatch({
  file <- "/tmp/test"
  stopaste0("Error in file: ", file)
}, error = function(error) {
  print(error)
})

Run the code above in your browser using DataLab