Displaying 20 results from an estimated 50000 matches similar to: "memory bug in is.na[n]() (PR#952)"
2016 Aug 17
1
table(exclude = NULL) always includes NA
The quirk as in table(1:3, exclude = 1, useNA = "ifany") is actually somewhat documented, and still in R devel r71104. In R help on 'table', in "Details" section:
It is best to supply factors rather than rely on coercion. In particular, ?exclude? will be used in coercion to a factor, and so values (not levels) which appear in ?exclude? before coercion will be mapped to
2016 Aug 15
1
table(exclude = NULL) always includes NA
>>>>> Martin Maechler <maechler at stat.math.ethz.ch>
>>>>> on Mon, 15 Aug 2016 11:07:43 +0200 writes:
>>>>> Suharto Anggono Suharto Anggono <suharto_anggono at yahoo.com>
>>>>> on Sun, 14 Aug 2016 03:42:08 +0000 writes:
>> useNA <- if (missing(useNA) && !missing(exclude) && !(NA %in%
2018 Jan 20
1
max and pmax of NA and NaN
Extremes.Rd, that documents 'max' and 'pmax', has this in "Details" section, in the paragraph before the last.
By definition the min/max of a numeric vector containing an NaN is NaN, except that the min/max of any vector containing an NA is NA even if it also contains an NaN.
------------------
>>>>> Michal Burda <michal.burda at centrum.cz>
2002 Oct 21
1
dist() {"mva" package} bug: treats +/- Inf as NA
Vince Carey found this (thank you!).
Since the fix to the problem is not entirely obvious, I post
this to R-devel as RFC:
help(dist) says:
>> Missing values are allowed, and are excluded from all computations
>> involving the rows within which they occur. If some columns are
>> excluded in calculating a Euclidean, Manhattan or Canberra
>> distance, the sum is
2016 May 28
1
complex NA's match(), etc: not back-compatible change proposal
On 'factor', I meant the case where 'levels' is not specified, where 'unique' is called.
> factor(c(complex(real=NaN), complex(imaginary=NaN)))
[1] NaN+0i <NA>
Levels: NaN+0i
Look at <NA> in the result above. Yes, it happens in earlier versions of R, too.
On matching both NA and NaN, another consequence is that length(unique(.)) may depend on order.
2016 Aug 14
2
table(exclude = NULL) always includes NA
useNA <- if (missing(useNA) && !missing(exclude) && !(NA %in% exclude)) "ifany"
An example where it change 'table' result for non-factor input, from https://stat.ethz.ch/pipermail/r-help/2005-April/069053.html :
x <- c(1,2,3,3,NA)
table(as.integer(x), exclude=NaN)
I bring the example up, in case that the change in result is not intended.
2010 Mar 31
2
Should as.complex(NaN) -> NA?
I'm having trouble grokking complex NaN's.
This first set examples using complex(re=NaN,im=NaN)
give what I expect
> Re(complex(re=NaN, im=NaN))
[1] NaN
> Im(complex(re=NaN, im=NaN))
[1] NaN
> Arg(complex(re=NaN, im=NaN))
[1] NaN
> Mod(complex(re=NaN, im=NaN))
[1] NaN
> abs(complex(re=NaN, im=NaN))
[1] NaN
and so do the following
> Re(complex(re=1,
2009 Apr 30
2
NA_real_ <op> NaN -> NA or NaN, should we care?
On Linux when I compile R 2.10.0(devel) (src/main/arithmetic.c in
particular)
with gcc 3.4.5 using the flags -g -O2 I get noncommutative behavior when
adding NA and NaN:
> NA_real_ + NaN
[1] NaN
> NaN + NA_real_
[1] NA
If I compile src/main/arithmetic.c without optimization (just -g)
then both of those return NA.
On Windows, using a precompiled R 2.8.1 from CRAN I get
NA for
2023 Nov 07
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
Thanks Martin. My hang-up was not on what the outcome of as.complex(NA)
should be, but rather, how I should read code like c(x, y) generally. Till
now, I have thought of it like 'c(x, y)' is c(as(x, typeof(y)), y)` when
"type(y) > type(x)". Basically in my mind, "coercion" in R <->
as.<newtype>(.) (or coerceVector() in C).
So I tracked down the source
2016 May 13
1
complex NA's match(), etc: not back-compatible change proposal
That, for example, complex(real=NaN) and complex(imaginary=NaN) are regarded as equal makes it possible that length(unique(as.character(x))) > length(unique(x)) (current code of function 'factor' doesn't expect it). Yes, an argument for the behavior is that NA and NaN are of one kind.
On my system, using 32-bit R for Windows from binary from CRAN, the result of sapply(z, match,
2001 May 28
0
bugs in deriv(*, *, function.arg = ) (PR#953)
Also, this should have gone in R-bugs quite a while ago :
------- start of forwarded message -------
From: Martin Maechler <maechler@stat.math.ethz.ch>
To: R-core@stat.math.ethz.ch
Subject: PROTECT() bugs in deriv(*, *, function.arg = )
Date: Mon, 16 Apr 2001 21:02:10 +0200
In R versions 0.50 and 0.64.2 ,
the following worked
> deriv(expression(sin(cos(x) * y)),
2023 Nov 06
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
>>>>> Michael Chirico
>>>>> on Sun, 5 Nov 2023 09:41:42 -0800 writes:
> This is another follow-up to the thread from September
> "Recent changes to as.complex(NA_real_)".
> A test in data.table was broken by the changes for NA
> coercion to complex; the breakage essentially comes from
> c(NA, 0+1i)
> # vs
2018 Jan 15
1
max and pmax of NA and NaN
Dear R users,
is the following OK?
> max(NA, NaN)
[1] NA
> max(NaN, NA)
[1] NA
> pmax(NaN, NA)
[1] NA
> pmax(NA, NaN)
[1] NaN
...or is it a bug? Documentation says that NA has a higher priority over
NaN.
Best regards, Michal Burda
[[alternative HTML version deleted]]
2016 May 10
1
complex NA's match(), etc: not back-compatible change proposal
This is an RFC / announcement related to the 2nd part of PR#16885
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16885
about complex NA's.
The (somewhat rare) incompatibility in R's 3.3.0 match() behavior for the
case of complex numbers with NA & NaN's {which has been fixed for R 3.3.0
patched in the mean time} triggered some more comprehensive "research".
I
1999 Oct 08
1
floor(NaN) problem fixed in massdist.c (PR#291)
Full_Name: Naoki Takebayashi
Version: 0.65.0+R-release.diff (Oct 6, 1999)
OS: Linux/Alpha
Submission from: (NULL) (129.79.224.171)
This will fix the "problem 2 (crash in fft)" in Bug ID #277
On Linux/Alpha, make check failed because R could not handle the following
example in base-Ex.R
##___ Examples ___:
# The Old Faithful geyser data
data(faithful)
:
:
## Missing values:
x <-
2017 Jan 11
2
accelerating matrix multiply
> Do you have R code (including set.seed(.) if relevant) to show on how to generate
> the large square matrices you've mentioned in the beginning? So we get to some
> reproducible benchmarks?
Hi Martin,
Here is the program I used. I only generate 2 random numbers and reuse them to make the benchmark run faster. Let me know if there is something I can do to help--alternate
2019 Mar 06
1
as.Date(Inf) displays as 'NA' but is actually 'Inf'
>>>>> Gabriel Becker
>>>>> on Tue, 5 Mar 2019 22:01:37 -0800 writes:
> On Tue, Mar 5, 2019 at 9:54 PM Richard White <w at rwhite.no> wrote:
>> Hi Gabriel,
>>
>> The point is that it *visually* displays as NA, but is.na() still
>> responds as FALSE.
>>
>> When I (and I am sure many people)
2020 Aug 31
1
make check fails due to NA / NaN mismatch
Thank you for the introduction to these recent changes, Martin.
I think this was the second time I ran "make check" on that platform (Raspberry Pi 32-bit), and the first time (some months ago) it worked fine. So, that makes it kind of "suddenly", although I must say that my use of "make check" is very irregular.
I compared code before and after the split you are
2023 Nov 09
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
>>>>> Mikael Jagan
>>>>> on Wed, 8 Nov 2023 11:13:18 -0500 writes:
> So, to summarize, the open questions are:
> (1) Should as.complex(NA_character_) give complex(r=NA_real_, i=0)
> instead of NA_complex_?
> (2) Should the first argument in c(NA, x) and c(NA_integer_, x),
> where typeof(x) == "complex", be promoted
2023 Nov 08
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
So, to summarize, the open questions are:
(1) Should as.complex(NA_character_) give complex(r=NA_real_, i=0)
instead of NA_complex_?
(2) Should the first argument in c(NA, x) and c(NA_integer_, x),
where typeof(x) == "complex", be promoted to complex(r=NA_real_, i=0)
instead of NA_complex_?
My opinions:
(1) No. The imaginary part of the