Displaying 15 results from an estimated 15 matches similar to: "speed up R_IsNA, R_IsNaN for vector input"
2019 Sep 30
0
speed up R_IsNA, R_IsNaN for vector input
On 9/29/19 1:09 PM, Jan Gorecki wrote:
> Dear R developers,
>
> I spotted that R_isNA and R_IsNaN could be improved when applied on a
> vector where we could take out small part of their logic, run it once,
> and then reuse inside the loop.
Dear Jan,
Looking at your examples, I just see you have hand-inlined
R_IsNA/R_IsNaN, or is there anything more? In principle we could put
2011 Dec 02
1
1.6x speedup for requal() function (in R/src/main/unique.c)
Hi,
FWIW:
/* Taken from R/src/main/unique.c */
static int requal(SEXP x, int i, SEXP y, int j)
{
if (i < 0 || j < 0) return 0;
if (!ISNAN(REAL(x)[i]) && !ISNAN(REAL(y)[j]))
return (REAL(x)[i] == REAL(y)[j]);
else if (R_IsNA(REAL(x)[i]) && R_IsNA(REAL(y)[j])) return 1;
else if (R_IsNaN(REAL(x)[i]) && R_IsNaN(REAL(y)[j])) return 1;
2020 Jan 01
2
New R function is.nana = is.na & !is.nan
Hello R-devel,
Best wishes in the new year. I am writing to kindly request new R
function so NA_real_ can be more easily detected.
Currently if one wants to test for NA_real_ (but not NaN) then extra
work has to be done: `is.na(x) & !is.nan(x)`
Required functionality is already at C level so to address my request
there is not that much to do.
Kevin Ushey made a nice summary of current R C api
2020 Jan 02
1
New R function is.nana = is.na & !is.nan
"nana" is meant to express "NA, really NA".
Your suggestion sounds good.
On Thu 2 Jan, 2020, 3:38 AM Pages, Herve, <hpages at fredhutch.org> wrote:
> Happy New Year everybody!
>
> The name (is.nana) doesn't make much sense to me. Can you explain it?
>
> One alternative would be to add an extra argument (e.g. 'strict') to
> is.na(). FALSE by
2008 Aug 16
1
unique.default problem (PR#12551)
Full_Name: Vilmos Prokaj
Version: R 2.7.1
OS: windows
Submission from: (NULL) (213.181.195.84)
Dear developers,
The following line of code (produced by a mistake) caused an infinite loop
unique("a",c("a","b"))
or also
unique(1,1:2)
I made a little investigation, and it seems to be that the following function
from unique.c is looping infinitely
static int
2004 Oct 22
1
Incompatibility between R-2.0.0 and Rggobi_1.0-0.
Hello,
I was trying to install Rggobi in the latest version of R and it gave me
a compilation error for
R CMD INSTALL Rggobi_1.0-0.tar.gz
RSGGobi.C: In function RS_GGOBI_init
(R_IsNaNorNA) undeclared (line 77)
I searched for this function in R src files and it was abandoned in
~/R-2.0.0/src/include/R_ext/Arith.h file.
Only functions
int R_IsNA(double); /* True for R's NA only */
2009 Jul 14
1
Incorrect comment about ISNA(x) in Arith.h (PR#13826)
R-2.9.0/include/R_ext/Arith.h has:
int R_IsNA(double); /* True for R's NA only */
int R_IsNaN(double); /* True for special NaN, *not* for NA */
int R_finite(double); /* True if none of NA, NaN, +/-Inf */
#define ISNA(x) R_IsNA(x)
/* True for *both* NA and NaN.
The first and last lines are contradictory - if R_IsNA is true only
for NA, not NaN, then ISNA should be the same.
2014 Feb 10
1
Question re: NA, NaNs in R
Hi R-devel,
I have a question about the differentiation between NA and NaN values
as implemented in R. In arithmetic.c, we have
int R_IsNA(double x)
{
if (isnan(x)) {
ieee_double y;
y.value = x;
return (y.word[lw] == 1954);
}
return 0;
}
ieee_double is just used for type punning so we can check the final
bits and see if they're equal to 1954; if they are, x is NA, if
they're
2010 Jan 22
2
Optimizing C code
Hi the list,
I need to write some efficient distances function, so I read the code
for the Euclidean distance.
I do not understand the purpose of the line 11 : if x[i] and y[i] are
not NA (line 9), can dev be NA ?
Christophe
#define both_FINITE(a,b) (R_FINITE(a) && R_FINITE(b))
#define both_non_NA(a,b) (!ISNAN(a) && !ISNAN(b))
1. static double R_euclidean2(double *x, double
2020 Jan 01
0
New R function is.nana = is.na & !is.nan
Happy New Year everybody!
The name (is.nana) doesn't make much sense to me. Can you explain it?
One alternative would be to add an extra argument (e.g. 'strict') to
is.na(). FALSE by default, and ignored (with or w/o a warning) when the
type of 'x' is not "numeric".
H.
On 12/31/19 22:16, Jan Gorecki wrote:
> Hello R-devel,
>
> Best wishes in the new
2005 Jan 05
1
Standalone Mathlib, C++ and ISNAN()
In the hope of some meaningful response and ignoring the risk of
further abuse, let me try to clarify the issue here.
I have re-read the 'Writing R Extensions' manual. It seems to me that
it clearly says R API functions can be called from from C++ programs,
and the API includes the special values ISNAN() and R_FINITE() and the
missing test ISNA().
R_FINITE is no problem. It is
1999 Sep 13
5
axis() produces junk on DEC alpha (PR#274)
Full_Name: Albrecht Gebhardt
Version: 0.65.0
OS: Digital Unix 4.0E
Submission from: (NULL) (212.17.104.62)
Plottimg on the Alpha stopped working with 0.65.0.
The tickmarks have a length of -Inf and go across the whole
plot.
A first solution is the following patch:
--- src/main/plot.c.alpha-patch Mon Sep 13 01:37:11 1999
+++ src/main/plot.c Mon Sep 13 01:58:16 1999
@@ -832,7 +832,7 @@
1999 Mar 12
1
R 68.3 on OSF V4.0 problems
I am trying to install R-0.63.3 on a Digital Alpha running OSF V4.0D, and
having some difficulties. Can anyone help?
Also, I found some "oddities" in the installation process. I expect that
this message is read by the developers, maybe some of my suggestions can be
incorporated into future releases.
Please reply to me directly (as well as possibly also to this mailing list):
I am not a
2000 Mar 03
1
compiling R-1.0.0 on dec alpha (digital Unix 4.0)
I have tried compiling R on a dec alpha running digital unix 4.0 and
got the following:
f77 -shared -o ts.so PPsum.o burg.o eureka.o filter.o pacf.o starma.o stl.o carray.o mburg.o myw.o qr.o -lUfor -lfor -lFutil -lm -lots -lm
ld:
Warning: Unresolved:
R_alloc
R_NaReal
R_IsNA
R_IsNaNorNA
R_chk_calloc
R_chk_free
Rf_error
vmaxget
vmaxset
dqrdc2_
dqrcf_
mkdir ../../../../library/ts/libs
gmake[4]:
2002 Jul 11
1
dyn.load tcl/tk (PR#1774)
<<insert bug report here>>
------------------------------------------------------
Error:
R : Copyright 2002, The R Development Core Team
Version 1.5.1 (2002-06-17)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type `license()' or `licence()' for distribution details.
R is a collaborative project with