Re: [Rd] surprisingly, S4 classes with a "dim" or "dimnames" slot are final (in the Java sense)

2017-06-06 Thread Hervé Pagès
Thanks Michael for taking care of this. H. On 06/06/2017 11:48 AM, Michael Lawrence wrote: I've fixed this and will commit soon. Disregard my dim<-() example; that behaves as expected (the class needs a dim<-() method). Michael On Tue, Jun 6, 2017 at 5:16 AM, Michael Lawrence mailto:micha...

Re: [Rd] Philosophy behind converting Fortran to C for use in R

2017-06-06 Thread William Dunlap via R-devel
Here are three reasons for converting Fortran code, especially older Fortran code, to C: 1. The C-Fortran interface is not standardized. Various Fortran compilers pass logical and character arguments in various ways. Various Fortran compilers mangle function and common block names in variousl wa

[Rd] Philosophy behind converting Fortran to C for use in R

2017-06-06 Thread Avraham Adler
Hello. This is not a question about a bug or even best practices; rather I'm trying to understand the philosophy or theory as to why certain portions of the R codebase are written as they are. If this question is better posed elsewhere, please point me in the proper direction. In the thread about

Re: [Rd] Usage of PROTECT_WITH_INDEX in R-exts

2017-06-06 Thread Kirill Müller
On 06.06.2017 10:07, Martin Maechler wrote: Kirill Müller on Mon, 5 Jun 2017 17:30:20 +0200 writes: > Hi I've noted a minor inconsistency in the documentation: > Current R-exts reads > s = PROTECT_WITH_INDEX(eval(OS->R_fcall, OS->R_env), &ipx); > but I believe it ha

Re: [Rd] surprisingly, S4 classes with a "dim" or "dimnames" slot are final (in the Java sense)

2017-06-06 Thread Michael Lawrence
I've fixed this and will commit soon. Disregard my dim<-() example; that behaves as expected (the class needs a dim<-() method). Michael On Tue, Jun 6, 2017 at 5:16 AM, Michael Lawrence wrote: > Thanks for the report. The issue is that one cannot set special attributes > like names, dim, dimna

Re: [Rd] Unexpected interaction between missing() and a blank expression

2017-06-06 Thread peter dalgaard
> On 6 Jun 2017, at 18:50 , Hong Ooi via R-devel wrote: > > This is something I came across just now: > > f <- function(x) missing(x) > z <- quote(expr=) > > f(z) > # TRUE > > The object z contains the equivalent of a missing function argument. Another > method for generating a missing arg w

[Rd] Unexpected interaction between missing() and a blank expression

2017-06-06 Thread Hong Ooi via R-devel
This is something I came across just now: f <- function(x) missing(x) z <- quote(expr=) f(z) # TRUE The object z contains the equivalent of a missing function argument. Another method for generating a missing arg would be alist(a=)$a . Should f(z) return TRUE in this case? I interpret missing(

Re: [Rd] [bug] droplevels() also drop object attributes (comment…)

2017-06-06 Thread Martin Maechler
> Martin Maechler > on Tue, 16 May 2017 11:01:23 +0200 writes: > Serge Bibauw > on Mon, 15 May 2017 11:59:32 -0400 writes: >> Hi, >> Just reporting a small bug… not really a big deal, but I >> don’t think that is intended: droplevels() also drops all >>

Re: [Rd] surprisingly, S4 classes with a "dim" or "dimnames" slot are final (in the Java sense)

2017-06-06 Thread Michael Lawrence
Thanks for the report. The issue is that one cannot set special attributes like names, dim, dimnames, etc on S4 objects. I was aready working on this and will have a fix soon. > a2 <- new("A2") > dim(a2) <- c(2, 3) Error in dim(a2) <- c(2, 3) : invalid first argument On Mon, Jun 5, 2017 at 6:08

Re: [Rd] Usage of PROTECT_WITH_INDEX in R-exts

2017-06-06 Thread Martin Maechler
> Kirill Müller > on Mon, 5 Jun 2017 17:30:20 +0200 writes: > Hi I've noted a minor inconsistency in the documentation: > Current R-exts reads > s = PROTECT_WITH_INDEX(eval(OS->R_fcall, OS->R_env), &ipx); > but I believe it has to be > PROTECT_WITH_INDEX(s = eva

Re: [Rd] sum() returns NA on a long *logical* vector when nb of TRUE values exceeds 2^31

2017-06-06 Thread Martin Maechler
> Hervé Pagès > on Fri, 2 Jun 2017 04:05:15 -0700 writes: > Hi, I have a long numeric vector 'xx' and I want to use > sum() to count the number of elements that satisfy some > criteria like non-zero values or values lower than a > certain threshold etc... > The pr