search for: na_integ

Displaying 20 results from an estimated 73 matches for "na_integ".

Did you mean: na_integer
2010 Sep 08
0
Correction to vec-subset speed patch
...ows and columns of a large array, where the improvement is by about a factor of four. Extracting many rows from one column of a matrix is sped up by about 30%. Changes unrelated to speed improvement: Fixes two latent bugs where the code incorrectly refers to NA_LOGICAL when NA_INTEGER is appropriate and where LOGICAL and INTEGER types are treated as interchangeable. These cause no problems at the moment, but would if representations were changed. patch-subscript (Formerly part of patch-vec-subset) This patch also speeds up extraction, and also replacement,...
2002 Mar 08
1
1st January isn't (PR#1370)
In today's pre1.5.0 > ISOdate(2002,1,1) [1] "2002-03-01 04:00:00 PST" > ISOdate(2002,1,1)==ISOdate(2002,3,1) [1] TRUE It doesn't seem to happen for days other than 1/1 -thomas > version _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status Under development (unstable) major 1 minor 5.0 year 2002 month
2019 Jan 11
2
strtoi output of empty string inconsistent across platforms
...gt;>>> Michael Chirico >>>>> on Fri, 11 Jan 2019 14:36:17 +0800 writes: >> Identified as root cause of a bug in data.table: >> https://github.com/Rdatatable/data.table/issues/3267 >> On my machine, strtoi("", base = 2L) produces NA_integer_ >> (which seems consistent with ?strtoi: "Values which >> cannot be interpreted as integers or would overflow are >> returned as NA_integer_"). > indeed consistent with R's documentation on strtoi(). > What machine would that be? &g...
2019 Jan 11
2
strtoi output of empty string inconsistent across platforms
Identified as root cause of a bug in data.table: https://github.com/Rdatatable/data.table/issues/3267 On my machine, strtoi("", base = 2L) produces NA_integer_ (which seems consistent with ?strtoi: "Values which cannot be interpreted as integers or would overflow are returned as NA_integer_"). But on all the other machines I've seen, 0L is returned. This seems to be consistent with the output of a simple C program using the underlying st...
2015 May 17
1
The function cummax() seems to have a bug.
Hi, The function cummax() seems to have a bug. > x <- c(NA, 0) > storage.mode(x) <- "integer" > cummax(x) [1] NA 0 The correct result of this case should be NA NA. The mistake in [ https://github.com/wch/r-source/blob/trunk/src/main/cum.c#L130-L136] may be the reason. Best Regards, Dongcan -- Dongcan Jiang Team of Search Engine & Web Mining School of Electronic
2015 Sep 20
2
Long vectors: Missing values and R_xlen_t?
Is there a missing value constant defined for R_xlen_t, cf. NA_INTEGER (== R_NaInt == INT_MIN) for int(eger)? If not, is it correct to assume that missing values should be taken care/tested for before coercing from int or double? Thank you, Henrik
2009 Jun 18
2
Argument as.integer(NA) to a function C
...quot;essai",as.integer(boub),NAOK=TRUE) # T0=1 T1=2 T2=-2147483648 T3=4[[1]] # [1] 1 2 NA 4 --- --- In the second example, T2=-2147483648 and not NA. I check the "writing R extension", there is a part that explain that the test of NA is not the same between double and integer (NA_INTEGER, ISNA), but I did not find explanation on passing NA argument as integer. Any idea of what is wrong in my code? Christophe
2009 Feb 27
0
POSIXlt, POSIXct, strptime, GMT and 1969-12-31 23:59:59
...eeBSD and Ubuntu as well with the same outcome. It does seem to work fine on Windows though. I think the workaround for Windows is what is causing the failure elsewhere. As far as I can see, the code that is causing this is do_asPOSIXct in datetime.c: 695 if(!R_FINITE(secs) || tm.tm_min == NA_INTEGER || 696 tm.tm_hour == NA_INTEGER || tm.tm_mday == NA_INTEGER || 697 tm.tm_mon == NA_INTEGER || tm.tm_year == NA_INTEGER) 698 REAL(ans)[i] = NA_REAL; 699 else { 700 errno = 0; 701 tmp = mktime0(&tm, 1 - isgmt); 702 #ifdef MKTIME_SETS_ERRNO 703...
2010 Jan 18
0
Fix for bug in match()
...hen removed by (potentially multiple) calls to removeEntry(): static void removeEntry(SEXP table, SEXP x, int indx, HashData *d) { int i, *h; h = INTEGER(d->HashTable); i = d->hash(x, indx, d); while (h[i] != NIL) { if (d->equal(table, h[i], x, indx)) { h[i] = NA_INTEGER; /* < 0, only index values are inserted */ return; } i = (i + 1) % d->M; } h[i] = NA_INTEGER; } Removing a value x sets the corresponding cell to NA_INTEGER. If x is not element of the table, the cell where it would have been is set from NIL (-1) to NA_INTEGER. T...
2019 Jan 11
0
strtoi output of empty string inconsistent across platforms
>>>>> Michael Chirico >>>>> on Fri, 11 Jan 2019 14:36:17 +0800 writes: > Identified as root cause of a bug in data.table: > https://github.com/Rdatatable/data.table/issues/3267 > On my machine, strtoi("", base = 2L) produces NA_integer_ > (which seems consistent with ?strtoi: "Values which cannot > be interpreted as integers or would overflow are returned > as NA_integer_"). indeed consistent with R's documentation on strtoi(). What machine would that be? > But on all the other machin...
2019 Jan 12
0
strtoi output of empty string inconsistent across platforms
...rico > >>>>> on Fri, 11 Jan 2019 14:36:17 +0800 writes: > > >> Identified as root cause of a bug in data.table: > >> https://github.com/Rdatatable/data.table/issues/3267 > > >> On my machine, strtoi("", base = 2L) produces NA_integer_ > >> (which seems consistent with ?strtoi: "Values which > >> cannot be interpreted as integers or would overflow are > >> returned as NA_integer_"). > > > indeed consistent with R's documentation on strtoi(). > > What m...
2005 Nov 18
1
using a factor as col argument in plot:
Dear R core team Using the following code produces an empty plot (similar to col = NA): > plot(1:9, col = factor(rep(1:3,3), labels = c("red", "blue", "black"))) My question: Shouldn't one get at least a warning (or an error) if one tries to use a factor as col argument? Thanks for an answer. Regards, Christoph Buser
1997 Jul 30
0
R-alpha: line types
...t;red") rect(1,0,2,0.5) abline(v=2) rect(3,0,4,0.5) Here are some diffs (now all I have to do is wade through and get lwd working properly ...) *** devX11.c.orig Tue Jul 29 16:44:19 1997 --- devX11.c Tue Jul 29 16:57:55 1997 *************** *** 671,676 **** --- 671,677 ---- } if (fg != NA_INTEGER) { SetColor(fg); + SetLinetype(GP->lty); XDrawRectangle(display, window, wgc, (int)x0, (int)y0, (int)x1 - (int)x0, (int)y1 - (int)y0); } *** devPS.c.orig Sun Jul 6 21:29:03 1997 --- devPS.c Tue Jul 29 17:01:05 1997 *************** *** 433,438 **** --- 433,439 ---- } if...
2019 Sep 03
2
[ALTREP] What is the meaning of the return value of Is_sorted and No_NA function?
Hi, I would like to figure out the meaning of the return value of these two functions. Here are the default definitions I find from R source code: static int altreal_Is_sorted_default(SEXP x) { return UNKNOWN_SORTEDNESS; } static int altreal_No_NA_default(SEXP x) { return 0; } I guess the macro *UNKNOWN_SORTEDNESS *in *Is_sorted* and 0 in *No_NA *simply means unknown sorted/NA status of
2015 Sep 21
0
Long vectors: Missing values and R_xlen_t?
On Sep 20, 2015, at 3:06 PM, Henrik Bengtsson <henrik.bengtsson at ucsf.edu> wrote: > Is there a missing value constant defined for R_xlen_t, cf. NA_INTEGER > (== R_NaInt == INT_MIN) for int(eger)? If not, is it correct to > assume that missing values should be taken care/tested for before > coercing from int or double? > R_xlen_t is type of the vector length (see XLENGTH()) and as such never holds a missing value (since there is no su...
2019 Jan 21
0
orderVector1 (sort.c): Tiny improvement concerning nalast
...rgas/R-3.5.2/src/main/sort.c 2018-11-07 00:15:02.000000000 +0100 --- /home/emilio/Descargas/R-3.5.2/src/main/sort2.c 2019-01-21 11:13:07.414332755 +0100 *************** *** 1079,1099 **** switch (TYPEOF(key)) { case LGLSXP: case INTSXP: ! for (i = 0; i < n; i++) isna[i] = (ix[i] == NA_INTEGER); ! break; case REALSXP: ! for (i = 0; i < n; i++) isna[i] = ISNAN(x[i]); ! break; case STRSXP: ! for (i = 0; i < n; i++) isna[i] = (sx[i] == NA_STRING); ! break; case CPLXSXP: ! for (i = 0; i < n; i++) isna[i] = ISNAN(cx[i].r) || ISNAN(cx[i].i); !...
2012 Feb 26
2
Dealing with NAs in C
Hi. I am currently converting a lot of R code to C in order to make it more efficient. A lot of the data involves NAs. As the data is mainly integers > 0, I am just setting all NAs to 0 then sending it to the C code then resetting them to NAs again after the C program is done, to be compatible with the rest of the R code. Is there a more efficient way to deal with NAs in C? I have used
2006 Mar 30
0
function min does not return correct result if .Machine$integer.max (PR#8732)
The code has s = INT_MAX; for (i = 0; i < n; i++) { if (x[i] != NA_INTEGER) { if (s > x[i]) { s = x[i]; if(!updated) updated = 1; } } else if (!narm) { if(!updated) updated = 1; *value = NA_INTEGER; return(updated); } } *value = s; so it ignores the initial value INT_MAX (updated is not set). Fairly easy to fix ....
2019 Sep 11
0
[ALTREP] What is the meaning of the return value of Is_sorted and No_NA function?
Hi Jiefei, The meanings of the return values for sortedness can be found in RInternals.h, and are as follows: /* ALTREP sorting support */ enum {SORTED_DECR_NA_1ST = -2, SORTED_DECR = -1, UNKNOWN_SORTEDNESS = INT_MIN, /*INT_MIN is NA_INTEGER! */ SORTED_INCR = 1, SORTED_INCR_NA_1ST = 2, KNOWN_UNSORTED = 0}; The default value there is NA_INTEGER (ie INT_MIN), indicating that there is no sortedness information. Currently, *_NO_NA effectively return a boolean, (even though the actual return value is int). This can be...
2006 Jan 21
1
A patch for do_sample: check replace arg
...+ if (length(sreplace) != 1) + errorcall(call, _("invalid '%s' argument"), "replace"); + replace = asLogical(sreplace); if (replace == NA_LOGICAL) errorcall(call, _("invalid '%s' argument"), "replace"); if (n == NA_INTEGER || n < 1)