Displaying 7 results from an estimated 7 matches for "simplemessage".
2015 Sep 10
2
Using IDs to suppress specific messages and warnings
...locales.
See, for example,
https://stat.ethz.ch/pipermail/r-devel/2012-October/065089.html
A better way of suppressing certain conditions would be to allow them
to have an identifier. (This is how MATLAB allows control over
individual conditions.)
The implementation ought to be fairly simple.
simpleMessage, simpleWarning, and simpleError gain an id arg, which is
stored in their structure.
simpleMessage <- function (message, call = NULL, id = NULL)
{
structure(
list(message = message, call = call, id = id),
class = c("simpleMessage", "message", "condition")...
2015 Sep 10
0
Using IDs to suppress specific messages and warnings
...stat.ethz.ch/pipermail/r-devel/2012-October/065089.html
>
> A better way of suppressing certain conditions would be to allow them
> to have an identifier. (This is how MATLAB allows control over
> individual conditions.)
>
> The implementation ought to be fairly simple.
>
> simpleMessage, simpleWarning, and simpleError gain an id arg, which is
> stored in their structure.
>
> simpleMessage <- function (message, call = NULL, id = NULL)
> {
> structure(
> list(message = message, call = call, id = id),
> class = c("simpleMessage", "message...
2009 Feb 04
2
Capturing all warnings (with messages)
Dear all,
For an open-source project that I'm working on (1), which uses R for
all its heavy lifting but includes a wrapper shell script, I was
hoping to find a way to capture all warnings (and, in fact, errors
too), and handle them in my own way. I realise I can do this for a
single expression using something like:
> f <- function(w) print(w$message)
>
2023 Feb 19
2
R: determine if `suppressMessages()` has been invoked
...provided by
message() itself above.
We can use the fact that the availability of the "muffleMessage"
restart is a documented detail and check whether signalling a "message"
condition will call this restart:
are_messages_suppressed <- function() withRestarts(
{
signalCondition(simpleMessage(''))
# we stay here if restart is not invoked
FALSE
},
muffleMessage = function()
# we jump here if restart is invoked
TRUE
)
are_messages_suppressed()
# [1] FALSE
suppressMessages(are_messages_suppressed())
# [1] TRUE
I don't think I understand handlers and restarts enough to explain t...
2023 Feb 19
1
R: determine if `suppressMessages()` has been invoked
Hi all,
I would like to create a function that detects if suppressMessages has been invoked upon running that same function. I was looking through {https://cran.r-project.org/doc/manuals/r-release/R-ints.html}, but I haven't found an answer. I do not understand **how** suppressMessages works.
I have not received an answer on SO
2006 Apr 13
4
Wishlist: 'quietly' argument for .onAttach() / .First.lib()
Hi R-devels,
in "Writing R extensions" as well as in the help
to .onAttach(), you mention that one could
use this function to issue a start-up message/banner
for the package.
My little wish for Easter:
a 'quietly'-type argument for .onAttach() / .First.lib()
which is passed through by functions
require() and library() respectively,
and by means of which one could optionally
2013 Aug 20
7
Extending suggestion for stopifnot
I am using a variant of stopifnot a lot. can I suggest that base R
extends its functionality? I know how to do this for myself. this is
a suggestion for beginners and students. I don't think it would break
anything.
first, I think it would be more useful if it had an optional character
string, so users could write
stopifnot( is.matrix(m), "m is not a matrix" )
this would