Learn R Programming

W4MRUtils (version 1.2.1)

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

Description

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

Usage

stopaste(...)

Value

NULL

Arguments

...

Arguments passed on to base::paste

sep

a character string to separate the terms. Not NA_character_.

collapse

an optional character string to separate the results. Not NA_character_. When collapse is a string, the result is always a string (character of length 1).

recycle0

logical indicating if zero-length character arguments should result in the zero-length character(0). Note that when collapse is a string, recycle0 does not recycle to zero-length, but to "".

Author

L.Pavot

Examples

Run this code

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

Run the code above in your browser using DataLab