collect_note_if | R Documentation |
Add an entry to a list if condition
is TRUE
collect_note_if(msg_list, new_msg, condition, newline = TRUE)
msg_list |
A list of messages |
new_msg |
A new message to add to |
condition |
If TRUE, then add |
newline |
If TRUE, then add a new line to |
Before this function, error messages would be sent one at a time. Resultantly, users would spend time in a cycle of: run code, debug code, and repeat. However, it would be more efficient if the user received all possible error messages, rather than just the first error message, and then start debugging. This would ease the debugging process and perhaps later errors would provide insight into fixing the current error.
This function was created with the intention of collecting error messages in a list, and then printing all the error messages at the end. The hope was that users can debug all at one go, rather than debug incrementally.
The goal is to pass this list to stop
, warning
, etc.
To print each message on its own line, set newline
to TRUE.
msg_list
must be a list; new_msg
must be a string; and
condition
and newline
must be booleans.
If add
is TRUE, then the result will be all the messages in
msg_list
. Else, the function returns msg_list
.
Other dev:
send_note_if()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.