similar to: Using IDs to suppress specific messages and warnings

Displaying 20 results from an estimated 1000 matches similar to: "Using IDs to suppress specific messages and warnings"

2015 Sep 10
0
Using IDs to suppress specific messages and warnings
Conditions have classes and the condition system is designed around the idea that classes would be used for this sort of thing. That is already how tryCatch and withCallingHandlers discriminate the conditions to handle. Designing and implementing a condition class hierarchy to support this is indeed the hard/tedious part. Best, luke On Thu, 10 Sep 2015, Richard Cotton wrote: > The
2023 Feb 19
2
R: determine if `suppressMessages()` has been invoked
Awesome, this gets the job done. To answer your question: When using C or C++ via Rinside or within a package, those functions do not listen to suppressMessages, e.g. `Rprintf` keeps printing to the console. Since it's common to use wrapper functions in R anyway, they can run `are_messages_suppressed` and pass the information on to an explicit `verbose` argument of the C / C++ function.
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
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
2015 Sep 10
2
Using IDs to suppress specific messages and warnings
Thanks Luke, On 10 September 2015 at 14:47, <luke-tierney at uiowa.edu> wrote: > Conditions have classes and the condition system is designed around > the idea that classes would be used for this sort of thing. That is > already how tryCatch and withCallingHandlers discriminate the > conditions to handle. That makes sense. Though with my sqrt example, it's just a plain
2012 Oct 21
1
suppress *specific* warnings?
Not desperately important, but nice to have and possibly of use to others, is the ability to suppress specific warnings rather than suppressing warnings indiscriminately. I often know of a specific warning that I want to ignore (because I know that's it's a false positive/ignorable), but the current design of suppressWarnings() forces me to ignore *any* warnings coming from the
2009 Oct 24
2
warnings details
I am running R as an invisible subprocess in another program (RExcel). Using try I can catch errors and print the errors produced by an R statement. Is there a way to know if running a statement caused a warning message? last.warning gives me the last warning, but I do not have any indication what the statement was that caused the message. I can of course store last warning before I run a
2012 Mar 15
2
ggplot2: goem_smooth and suppress messages
Hi When I run my script using ggplot and geom_smooth I get messages that I would like to suppress: p <- ggplot(dataSubset) p <- p + aes(x = as.Date(factor(key),format="%Y%m%d")) + geom_line() p <- p + geom_smooth(span=0.2,se=FALSE,size=0.7) The messages look like this: geom_smooth: method="auto" and size of largest group is <1000, so using loess. Use 'method
2010 Dec 05
1
How to catch both warnings and errors?
Dear expeRts, I am struggling with warning/error handling. I would like to call a function which can produce either a) normal output b) a warning c) an error Since the function is called several (thousand) times in a loop, I would like to proceed "quietly" and collect the warnings and errors [to deal with them at a later point]. I have seen constructs with tryCatch (which can
2005 Aug 22
1
Fetching Warning Messages
Hi, I am facing one problem of fetching R warning messages in Java Code using Rserve. It is easier to trap R Error messages by using catching RSrvException. I came to know one way of fetching R Warning messages, i.e. using "withCallingHandlers", below is my Java Program, which uses withCallingHandlers of R : import org.rosuda.JRclient.*;
2017 Sep 14
1
Print All Warnings that Occurr in All Parallel Nodes
Dear R Users, I have developed the following code for importing a series of zipped CSV by parallel computing. My problems are that: A) Some ZIP Files (Which contain CSVs inside) are corrupted, and cannot be opened. B) After executing parRapply I can only see the last.warning variable error, for knowing which CSV have failed in each node, but I cannot see all warnings, only 1 at a time. So: *
2009 Mar 27
1
deleting/removing previous warning message in loop
Hello R Users, I am having difficulty deleting the last warning message in a loop so that the only warning that is produced is that from the most recent line of code. I have tried options(warn=1), rm(last.warning), and resetting the last.warning using something like: > warning("Resetting warning message") This problem has been addressed in a previous listserve string,
2011 Feb 18
2
How to flag those iterations which yield a warning?
Hi, I am running a simulation study with the survival::coxph. Some of the simulations result in problematic fits due to flat partial likelihood. So, you get the warning message: Warning message: In fitter(X, Y, strats, offset, init, control, weights = weights, ... : Loglik converged before variable 2 ; beta may be infinite. How can I keep track of the simulations which yield any kind of
2011 Oct 05
3
suppressing stderr output from system() calls
Dear list, I'm trying to suppress/redirect/squash the output from commands like install.packages, or download.file. The problem is that none of: sink(..., type="message"), sink(..., type="output"), capture.output, suppressMessages are quite doing the trick. Output gets written to the stderr stream, despite any combination of the above suppression commands. According to
2018 Jan 02
4
httr::content without message
Hi All: I am using httr to download files form a service, in this case a .csv file. When I use httr::content on the result, I get a message. Since this will be in a package. I want to suppress the message, but haven't figured out how to do so. The following should reproduce the result: myURL <-
2006 Jun 25
1
using withCallingHandlers, how to deal with warning( , immediate. = TRUE)?
Hello, I want to use withCallingHandlers(expr, warning = function(w) { ....}), that is, to use a custom warning handler. I want this handler to replicate the behavior of the usual handler. I have problems with the mode 'options(warn = 0)' where the warnings are delayed, except if calling 'warning("message", immediate. = TRUE). Indeed, if my custom warning handler
2008 Jan 11
1
How to disable output messages (prints or cats) from functions in R?
Hi everybody, I have to use a function that shows an output message like "# nonzero coefficients ..." followed with a lot of numbers depending on the input. This is very annoying because I have to run that function several times and I don't want to show this information. What I want is to disable that display but I don't know how to do it. I've tried it with
2016 Jul 04
2
cat() in proc.time?
Does anyone know if there's a reason that proc.time() uses cat() rather than message() to print the output when there has been an error in the process of timing? line 31 of time.R, https://github.com/wch/r-source/blob/e5b21d0397c607883ff25cca379687b86933d730/src/library/base/R/time.R#L31 on.exit(cat("Timing stopped at:", ppt(proc.time() - time), "\n")) This means that
2013 Apr 18
1
Suppress specific warnings
Hello, is there a convenient way to suppress only *specific* warnings? (I know about ?suppressWarnings) I depend on another package, from which I want to suppress only some warnings, but not others. Felix
2011 Dec 05
1
RcppArmadillo compilation error: R CMD SHLIB returns status 1
Dear all, running the example by D. Eddebuettel (http://dirk.eddelbuettel.com/blog/2011/04/23/) I get an error message. Specifically, the R code I was taking from the above example is ### BEGIN EXAMPLE ### suppressMessages(require(RcppArmadillo)) suppressMessages(require(Rcpp)) suppressMessages(require(inline)) code <- ' arma::mat coeff = Rcpp::as<arma::mat>(a); arma::mat