Displaying 20 results from an estimated 39 matches for "reprintf".
Did you mean:
eprintf
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 consol...
2019 Sep 15
2
REprintf could be caught by tryCatch(message)
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
Rprintf -> cat
Rprint/cat is of course not an exception, I listed it just for completeness.
The inconsistency I would like to report is about REprintf. It cannot
be caught by tryCatch(message). Warnings are errors are being caught
as expected.
Is there any chance to "fix&qu...
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
>> 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
>&g...
2019 Sep 15
2
[External] REprintf could be caught by tryCatch(message)
...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(). If this claim
> is made somewhere in R documentation please report it a a bug.
>
> > Rprintf -> cat
> >
> > Rprint/cat is of course not an exception, I listed it just for completeness.
>...
2019 Sep 15
0
[External] REprintf could be caught by tryCatch(message)
...9, 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(). If this claim
is made somewhere in R documentation please report it a a bug.
> Rprintf -> cat
>
> Rprint/cat is of course not an exception, I listed it just for completeness.
> The inconsistency I would like to...
2004 Jun 22
3
[Q] GET_DIM() crash on Windows only
...or later")
}
library.dynam("getdim", pkgname, libname)
}
src/getdim.c
------------
#include <R.h>
#include <Rdefines.h>
#include <R_ext/PrtUtil.h>
int GetMatrixDimen(SEXP vntX, int *nrow, int *ncol)
{
SEXP vntXdim;
int nX;
#ifdef DEBUG_GETDIM
REprintf("In GetMatrixDimen()...\n");
#endif
/**** Code crashes here on Windoze ******/
PROTECT(vntXdim = GET_DIM(vntX));
#ifdef DEBUG_GETDIM
REprintf("\tgot dimension object\n");
#endif
nX = GET_LENGTH(vntXdim);
#ifdef DEBUG_GETDIM
REprintf("\tgot length from dime...
2019 Sep 16
0
[External] REprintf could be caught by tryCatch(message)
...>>> 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(). If this claim
>> is made somewhere in R documentation please report it a a bug.
>>
>>> Rprintf -> cat
>>>
>>> Rprint/cat is of course not an exception, I listed it jus...
2003 Sep 08
1
Stifling REprintf() output
...LSE and the
url() wrapped in a try(). When the URL is not found I am already handling
it in a manner consistent with the rest of the package and the 'cannot
open' line is confusing some users.
The problem is that I can not figure out how to turn it off, the comment
in printutils says that REprintf writes to stderr and is not redirected by
sink(). The call in question appears to be coming from in_R_HTTPOpen, in
that if the HTTP return code is != 200 the REprintf is called.
Is there any way within R to keep this output from appearing?
Thanks
-J
2011 Apr 21
0
C source code question (Robustbase edition)
...right[i] = (i <= h) ? n : n - (i - h);
/* the n - (i-h) is from the paper; original code had `n' */
}
R_qsort(y, 1, n); /* y := sort(x) */
nl = (int64_t)n * (n + 1) / 2;
nr = (int64_t)n * n;
knew = k + nl;/* = k + (n+1 \over 2) */
found = FALSE;
#ifdef DEBUG_qn
REprintf("qn0(): h,k= %2d,%2d; nl,nr= %d,%d\n", h,k, nl,nr);
#endif
/* L200: */
while(!found && nr - nl > n) {
j = 0;
/* Truncation to float :
try to make sure that the same values are got later (guard bits !) */
for (i = 1; i < n; ++i) {
if (left[i] <= right[i])...
1999 Jun 14
1
readline/history size (PR#211)
...0 1999
@@ -580,6 +580,35 @@
else
R_NSize = value;
}
+#ifdef HAVE_LIBREADLINE
+#ifdef HAVE_READLINE_HISTORY_H
+ else if((value = (*av)[1] == 'h') || !strcmp(*av, "--histsize")) {
+ if(value)
+ REprintf("WARNING: option `-h' is deprecated. "
+ "Use `--histsize' instead.\n");
+ if(!value || (*av)[2] == '\0') {
+ ac--; av++; p = *av;
+ }
+ else p = &(*av)[2];
+...
2023 Feb 23
1
Compilation Error when DEBUG_approx Toggled on in RISC-V
...ng 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,
...)",
(double)nxy, (double)nout, Meth->kind);
#endif
However, there is no `Meth` defined in this function, causing a compilation
error when `DEBUG_approx` is toggled on. The real `Meth` is actually
defined in the `approx...
2005 Oct 10
2
Catching warning and error output
...solutions I can think of:
1) In my programmers' dream, there'd simply be three callbacks that I can
override: R_WriteConsole (exists), R_WriteWarning, and R_WriteError.
R_WriteWarning, and R_WriteError would be called from vwarningcall_dflt, and
verrorcall_dflt, respectively, instead of REprintf. The default
implementation of those, would of course simply call REprintf. Drawbacks:
a) REprintf is available for use in R_ext/Print.h. I'd miss out on any direct
calls of REprintf, while those should probably still be recorded as a
warning/error.
b) I'd have to add a fairly elaborate...
2009 Jan 28
2
File and console output does not work in C code
...ating images on the fly using the GD library.
Both of these outputs require to write into files from this C function.
Allthough everything goes smoothly from compilation and linking to
execution into R without errors, no file is created. I have also tried
to do some simple printf(), Rprintf() and REprintf() but even that
didn't gave me any visible output.
Am I missing something trivial? Could anyone give me a hint on why it
does not work?
Best regards,
Benjamin
--
Chromatin and Cell Biology Lab.
Institute for Human Genetics
141, rue de la Cardonille
F-34396 Montpellier
France
Phone +33-(0...
1999 Jul 27
1
ESRI Shape reader
Well Dr. Ripley helped me solve the first problem, next question
I need to do some debugging now that the function loads properly
into R. I checked the S documentation and to use the C I/O functions
you need to include newredef.h, this file doesn't exist in /src/include.
How does this work in R? under S3.4 on a dec station i could use
fprintf(stdout,..);
fflush(stdout);
thanks,
Nicholas
PS
2010 Jan 29
0
[BioC] Suppress output from getGEO
...r line. instead, it could be repeatedly
printing them on the same line, to give it a more progress bar-like look.
the function putdots (src/modules/internet/internet.c:218) is responsible
for printing the dots. after each 5x10 bunch of dots, it proceeds to the
next line:
if((i+1) % 50 == 0) REprintf("\n");
but it could instead just swipe the dots and start in the same line again:
if((i+1) % 50 == 0) REprintf("\r%55s\r", "");
it's ad hoc, of course, and requires some other changes to prevent the
progress bar from being rewritten too quickly, e.g., by rep...
2008 Apr 16
1
C++ complains abouct Rprintf signature
...ilar to RPrintf, is const.
If there is a need to keep it non-const in C please consider using the patch below in future releases.
Thanks,
Vadim
Patch to R-2.6.1/include/R_ext/Print.h
#ifdef __cplusplus
extern "C" {
#define CONST const
#endif
void Rprintf(CONST char *, ...);
void REprintf(CONST char *, ...);
void Rvprintf(const char *, va_list);
void REvprintf(const char *, va_list);
#ifdef __cplusplus
}
#undef CONST
#endif
[[alternative HTML version deleted]]
1999 Jan 27
1
cant restore .Rdata
Hi Folks,
I loaded a couple of quite large data sets into an R session and then
quit (after saving the image). Now I get:
Error: a read error occured
Fatal error: unable to restore saved data
(remove .RData or increase memory)
after trying to start my R session using something like:
R --vsize XXX --nsize 1000000
For any value of XXX (I went up to 300 or 400, which is as high as I could
go.
2008 Apr 03
2
g++ 4.3 warning: deprecated conversion from string constant to ‘char*’
Hello,
I've noticed that with g++ 4.3 I get the following "warning: deprecated
conversion from string constant to ?char*?" when I call e.g.,
Rprintf("Hello world"); or when I try to define a const char e.g., char
lower = 'L';
I am wrapping the c++ code in extern "C" {}. This seems to be something
new with g++ 4.3, because the same code compiled
2006 Apr 13
1
bus error on calling nmmin
...ot access memory.
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
Cannot access memory at address 0x0
Cannot access memory at address 0x0
#1 0x0054dd5c in REvprintf (format=0x5f0dc8 "%s", arg=0xbfffb5fc "")
at ../../../../R-2.1.1/src/main/printutils.c:541
#2 0x0054dab0 in REprintf (format=0xbfff9570 "Error: invalid
connection\n") at ../../../../R-2.1.1/src/main/printutils.c:458
#3 0x004de8c4 in verrorcall_dflt (call=0x0, format=0x5f0dc8 "%s",
ap=0xbfffda30 "???P") at ../../../../R-2.1.1/src/main/errors.c:470
#4 0x004dea1c in Rf_errorcall (call...
1999 Mar 25
4
readline() (PR#147)
Dear R developers,
I have found the following bug with readline() in R 0.63.3:
if you execute the menu-function and then the readline() function, then
readline() prompts "Selection:"
> a <- readline()
hello
> a
[1] "hallo"
> a <- menu(c("a", "b"), title="bitte:")
bitte:
1:a
2:b
Selection: 2
> a <- readline()
Selection: