similar to: REprintf could be caught by tryCatch(message)

Displaying 20 results from an estimated 600 matches similar to: "REprintf could be caught by tryCatch(message)"

2019 Sep 15
2
[External] REprintf could be caught by tryCatch(message)
Thank you Luke for prompt reply. Is it possible then to request a new function to R C API "message" that would equivalent to R "message" function? Similarly as we now have C "warning" and C "error" functions. Best, Jan On Sun, Sep 15, 2019 at 5:25 PM Tierney, Luke <luke-tierney at uiowa.edu> wrote: > > On Sun, 15 Sep 2019, Jan Gorecki wrote:
2019 Sep 15
0
[External] REprintf could be caught by tryCatch(message)
On Sun, 15 Sep 2019, Jan Gorecki wrote: > Dear R-devel community, > > There appears to be an inconsistency in R C API about the exceptions > that can be raised from C code. > Mapping of R C funs to corresponding R functions is as follows. > > error -> stop > warning -> warning > REprintf -> message This is wrong: REpintf is like cat with file = stderr().
2019 Sep 16
0
[External] REprintf could be caught by tryCatch(message)
You can file it as a wishlist item in the bug trackign system. Without a compelling case or a complete and well tested patch or both I doubt it will rise to the top of anyone's priority list. Best, luke On Sun, 15 Sep 2019, Jan Gorecki wrote: > Thank you Luke for prompt reply. > Is it possible then to request a new function to R C API "message" > that would equivalent to
2017 Nov 21
2
Are Rprintf and REprintf thread-safe?
Is it safe to call Rprintf and REprintf from a background thread? I'm working on a package that makes calls to fprintf(stderr, ...) on a background thread when errors happen, but when I run R CMD check, it says: Compiled code should not call entry points which might terminate R nor write to stdout/stderr instead of to the console, nor the system RNG. Is it safe to replace these calls
2017 Nov 21
1
Are Rprintf and REprintf thread-safe?
Thanks - I'll find another way to send messages to the main thread for printing. -Winston On Tue, Nov 21, 2017 at 12:42 PM, <luke-tierney at uiowa.edu> wrote: > On Tue, 21 Nov 2017, Winston Chang wrote: > >> Is it safe to call Rprintf and REprintf from a background thread? I'm >> working on a package that makes calls to fprintf(stderr, ...) on a >>
2004 Jun 22
3
[Q] GET_DIM() crash on Windows only
I have the following contrived code in package format. On Solaris and Mac OS X, code runs just fine. On Windows, it crashes the R environment with the "Send Bug Report" dialog. I tried R 1.8.1 (Win2K) and R 1.9 (WinXP) binaries with the same result. PCs otherwise appear properly configured for creating R packages. Anything blatantly wrong? Suggestions? TIA Relevant files from package
2003 Sep 08
1
Stifling REprintf() output
In some code that I have written, use of url() is generating the output line: "cannot open: HTTP status was `404 Not Found`" The problem is that I do not want R to be outputting any error messages - I have 'internet.info' set to 3, show.error.messages set to FALSE and the url() wrapped in a try(). When the URL is not found I am already handling it in a manner consistent with
2023 Feb 23
1
Compilation Error when DEBUG_approx Toggled on in RISC-V
Hi all, While compiling R to RISC-V64 architecture and debugging in R's C source codes, I think I have found a small bug. Can anyone please verify whether it is a real bug? The possible bug lies in the file `R-4.2.2/src/library/stats/src/approx.c` in function `R_approxfun` around line 148: #ifdef DEBUG_approx REprintf("R_approxfun(x,y, nxy = %.0f, .., nout = %.0f, method = %d,
2005 Oct 10
2
Catching warning and error output
Hi all, I'm working on a GUI frontend for R, and I'm looking for a good way to catch all warning- and error-output. The reason for this is mostly, that I would like to know, which sections of the output are "normal" output, warnings, and errors. This would allow for some nice features, such as highlighting warnings and errors in a different color, or popping up a message
2009 Jan 28
2
File and console output does not work in C code
Hello all, I am getting into trouble when trying to do standard I/O from a C function called within R environment. This function is written in a small C library that is loaded whith dyn.load() and called in R via the .C() interface. I need to debug the C code using a text file for some logs, and also to speed up its result visualization by creating images on the fly using the GD library. Both
2008 Apr 16
1
C++ complains abouct Rprintf signature
Dear R-devel, My g++ complains about the first argument to Rprintf being non-const char *. For example when compiling the line Rprintf("hello world\n"); the following warning is emitted: warning: deprecated conversion from string constant to 'char*' Is there a reason for the non-const? It is curious that Rf_error, which is similar to RPrintf, is const. If there is a need
2011 Apr 21
0
C source code question (Robustbase edition)
Hi all, I have been trying to add the line: h = n - p0 + 1; just after h = n / 2 + 1; (line 131) in the source code (the original paper mention this is possible for p0&lt;n). with p0 declared as an int (actually i used the same declaration protocol as n everywhere in the code). The &quot;new&quot; source compiles, but when i give it reasonable values of p0, it runs unto
2014 Oct 31
3
ScalarLogical and setAttrib
Is it expected that attributes set on a LGLSXP created by ScalarLogical will apply to all future objects created by ScalarLogical as well? For example: the 'test1' function below returns FALSE and 'test2' returns FALSE with an attribute: library(inline) test1 <- cfunction(body = 'return ScalarLogical(0);') test2 <- cfunction(body = ' SEXP success =
1999 Jun 14
1
readline/history size (PR#211)
Full_Name: Russell Senior Version: 0.64.0 OS: linux-2.2.x Submission from: (NULL) (198.107.133.11) It appears that the GNU readline history size is limited to 50 entries. This is apparently occurring because R is not bothering to override the readline default value (from readline-4.0): ./history.c:59:#define DEFAULT_HISTORY_GROW_SIZE 50 It appears that it ought to be possible to override
2012 Mar 17
1
how to pass 'raw' values with cfunction()?
I am having trouble handing "raw" data to a C function, using "cfunction", as demonstrated in the function and output pasted below. Can anyone suggest what I'm doing incorrectly? Thanks. Dan Kelley [Dalhousie University]. 1. TEST FILE library(inline) code <- 'Rprintf("inside f(), b is 0X%x\\n", *b);' f <-
2020 Jun 30
2
Build a R call at C level
Hi All, I was reading the R extension manual section 5.11 ( Evaluating R expression from C) and I tried to build a simple call to the sum function. Please see below. call_to_sum <- inline::cfunction( language = "C", sig = c(x = "SEXP"), body = " SEXP e = PROTECT(lang2(install(\"sum\"), x)); SEXP ans = PROTECT(eval(e, R_GlobalEnv)); UNPROTECT(2); return
2013 Feb 01
1
Problem using raw vectors with inline cfunction
Hello, >From what I understood from the documentation I found, when using the inline cfunction with convention=".C", R raw vectors should be given as unsigned char* to the C function. But consider the following script: library(inline) testRaw <- cfunction(signature(raw='raw', len='integer') , body=' int l = *len; int i = 0;
2010 Apr 13
3
Inline Package: void vs return type functions
Dear all, After having a look at the "inline" package and also going through the "Rcpp" package which is tighty related to it, it came to me this question: 1) my C/ C++ code has a return type (let say a double[][] or a user define class) 2) I am working with an extensive library built by someone else and I don't have the time/knowledge to change it by means of working
2020 Jun 30
3
Build a R call at C level
On 6/30/20 1:06 PM, Jan Gorecki wrote: > It is quite known that R documentation on R C api could be improved... Please see "5.11 Evaluating R expressions from C" from "Writing R Extensions" Best Tomas > Still R-package-devel mailing list should be preferred for this kind > of questions. > Not sure if that is the best way, but works. > > call_to_sum <-
1998 Nov 26
1
Saving memory usage -- .C(....., DUP = FALSE) danger?
Just found out [R 0.63, standard -v -n] : > rm(list=ls()) > gc() free total Ncells 96538 200000 Vcells 214008 250000 > hist(runif(50000)) Error: heap memory (1953 Kb) exhausted [needed 390 Kb more] which is a bit astonishing given that I still have room for 214000 double's > u1 <- runif(50000) > u2 <- runif(50000) > gc()