Re: [Rd] na.omit inconsistent with is.na on list

2021-08-11 Thread Toby Hocking
Also, the na.omit method for data.frame with list column seems to be inconsistent with is.na, > L <- list(NULL, NA, 0) > str(f <- data.frame(I(L))) 'data.frame': 3 obs. of 1 variable: $ L:List of 3 ..$ : NULL ..$ : logi NA ..$ : num 0 ..- attr(*, "class")= chr "AsIs" > is.na(f)

[Rd] na.omit inconsistent with is.na on list

2021-08-11 Thread Toby Hocking
na.omit is documented as "na.omit returns the object with incomplete cases removed." and "At present these will handle vectors," so I expected that when it is used on a list, it should return the same thing as if we subset via is.na; however I observed the following, > L <- list(NULL, NA, 0) > str

Re: [Rd] Double to uint64_t on M1

2021-08-11 Thread Dipterix Wang
Thank you, I guess I should convert double to uint64_t instead of int64_t... The reason why I asked is because bit64 package `bit64::as.integer64(2^63)` produces different results on my machine vs. another server. This package converts double to int64_t directly. Looks like this is a bug in the

Re: [Rd] Double to uint64_t on M1

2021-08-11 Thread Simon Urbanek
Dipterix, this has nothing to do with R. 2^63 is too large to be represented as singed integer, so the behavior is undefined - to quote from the C99 specs (6.3.1.4): "If the value of the integral part cannot be represented by the integer type, the behavior is undefined." Your subject doesn't

[Rd] Double to uint64_t on M1

2021-08-11 Thread Dipterix Wang
Hi, I was trying to convert REALSXP to int64_t in C, then found that converting 2^63 is inconsistent across platforms: On M1 ARM osx, 2^63 (double) bit converting to `int64_t` becomes 9223372036854775807 On x86_64 ubuntu server, 2^63 (double) bit converting to `int64_t` is -92233720368547758

Re: [Rd] [External] difference of m1 <- lm(f, data) and update(m1, formula=f)

2021-08-11 Thread luke-tierney
On Wed, 11 Aug 2021, Martin Maechler wrote: I'm diverting this from R-help to R-devel, because I'm asking / musing if and if where we should / could change R here (see below). Martin Maechler on 11 Aug 2021 11:51:25 +0200 Tim Taylor .. on 08:45:48 + writes: >> Manipulating formula

[Rd] difference of m1 <- lm(f, data) and update(m1, formula=f)

2021-08-11 Thread Martin Maechler
I'm diverting this from R-help to R-devel, because I'm asking / musing if and if where we should / could change R here (see below). > Martin Maechler on 11 Aug 2021 11:51:25 +0200 > Tim Taylor .. on 08:45:48 + writes: >> Manipulating formulas within different models I notice the