similar to: Question re: NA, NaNs in R

Displaying 20 results from an estimated 1100 matches similar to: "Question re: NA, NaNs in R"

2019 Sep 29
2
speed up R_IsNA, R_IsNaN for vector input
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. I setup tiny plain-C experiment. Taking R_IsNA, R_IsNaN from R's arithmetic.c, and building R_vIsNA and R_vIsNaN accordingly. For double input of size 1e9 (having some NA and NaN) I observed following
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
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
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 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
2003 Apr 06
1
RH 9 and R 1.7.0 Beta - Errors Resolved
Hi all, As you may recall, earlier this week I posted about errors in make check using 1.7.0 Beta under RH 9. Peter kindly contacted me off list and we have been running some checks and possible resolutions the past couple of days. The errors turned out to be (run individually): > !is.nan(c(1.,NA)) [1] TRUE FALSE > is.nan(c (1.,NaN,NA)) [1] FALSE TRUE TRUE >
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
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.
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 */
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
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
2003 Dec 30
1
Accuracy: Correct sums in rowSums(), colSums() (PR#6196)
Full_Name: Nick Efthymiou Version: R1.5.0 and above OS: Red Hat Linux Submission from: (NULL) (162.93.14.73) With the introduction of the functions rowSums(), colSums(), rowMeans() and colMeans() in R1.5.0, function "SEXP do_colsum(SEXP call, SEXP op, SEXP args, SEXP rho)" was added to perform the fast summations. We have an excellent opportunity to improve the accuracy by
2002 Aug 07
1
Change in NA_REAL behavior (PR#1886)
Full_Name: David Larsen Version: 1.5.1 OS: Redhat 7.2, w98, w2000 Submission from: (NULL) (128.206.66.65) I have c code that produces vector sequences for plotting. I use NA_REAL to create an NA that will pass back to R to break the line. This code worked fine upto R-1.5.0 It continues to work on Redhat7.2 Linux but on both windows98 and windows2000 the NA_REAL returns -6.623485e-229 on both
2001 Nov 05
1
Setting NA from C code
In the maps library, NA's are inserted between polygons so lines() can be used to draw all polygons at once. The code to do it is like this: *x++ = NA_REAL; *y++ = NA_REAL; where x and y are declared as double *x, *y, *range; and are the arguments passed in through a .C call. However, the values show up in R as -6.62314033633867e-229 instead of NA, so the
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
2005 Dec 14
1
R-beta on AIX5.2
I build R-beta on AIX5.2 is failed. make[3]: Entering directory `/home/nakama/Rbeta/R-beta/src/nmath' xlc_r -I. -I../../src/include -I../../src/include -I/usr/local/include -I/opt/freeware/include -DHAVE_CONFIG_H -q64 -I/usr/local/include -I/opt/freeware/include -O2 -D_ALL_SOURCE -D_LINUX_SOURCE_COMPAT -c mlutils.c -o mlutils.o "nmath.h", line 50.9: 1506-213 (S) Macro name calloc
2001 Jul 23
2
Installing RSPython with R 1.3.0
To get RSPython installed on my debian test box, I had to make a couple of changes not listed in ftp://www.omegahat.org/pub/Omega/RSPython/FAQ.html 1) I had to change $R_HOME/src/modules/X11 : $(R_X11_la): $(R_X11_la_OBJECTS) $(R_X11_la_DEPENDENCIES) $(SHLIB_LINK) -o $@ $(R_X11_la_LDFLAGS) $(R_X11_la_OBJECTS) $(R_X11_la_LIBADD) $(LIBS) to $(R_X11_la): $(R_X11_la_OBJECTS)
2001 Apr 09
1
syntax error in datetime.c (PR#901)
Full_Name: Naoki Takebayashi Version: 1.2.2 OS: Linux, RedHat 7.0/alpha Submission from: (NULL) (152.3.12.123) With RedHat 7.0/alpha (gcc 2.96-69), I encountered following error: gcc -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -mieee -O2 -mieee -c datetime.c -o datetime.o datetime.c: In function `do_systime': datetime.c:306: parse error before `ans'
2024 Jan 18
1
Choices to remove `srcref` (and its buddies) when serializing objects
? Tue, 16 Jan 2024 14:16:19 -0500 Dipterix Wang <dipterix.wang at gmail.com> ?????: > Could you recommend any packages/functions that compute hash such > that the source references and sexpinfo_struct are ignored? Basically > a version of `serialize` that convert R objects to raw without > storing the ancillary source reference and sexpinfo. I can show how this can be done, but
2010 Sep 08
0
Correction to vec-subset speed patch
I found a bug in one of the fourteen speed patches I posted, namely in patch-vec-subset. I've fixed this (I now see one does need to duplicate index vectors sometimes, though one can avoid it most of the time). I also split this patch in two, since it really has two different and independent parts. The patch-vec-subset patch now has only some straightforward (locally-checkable) speedups for