Re: [Rd] Possible bug in `class<-` when a class-specific '[[.' method is defined

2019-07-15 Thread Kevin Ushey
When RStudio builds the Environment pane, it will evaluate some R code on objects in your global environment (as you have seen). In particular, for better or worse, it calls `str()` on objects in the global environment, to get a short text summary of the object. So, to reproduce what you're seeing

Re: [Rd] Possible bug in `class<-` when a class-specific '[[.' method is defined

2019-07-15 Thread Rui Barradas
Hello, Inline. Às 14:26 de 15/07/19, Duncan Murdoch escreveu: On 15/07/2019 8:57 a.m., Rui Barradas wrote: Hello, Clean R 3.6.1 session on Ubuntu 19.04, RStudio 1.1.453. sessionInfo() at the end. That's not what I'd call a "clean session" with all those packages loaded: You are right, but

Re: [Rd] Possible bug in `class<-` when a class-specific '[[.' method is defined

2019-07-15 Thread Duncan Murdoch
On 15/07/2019 8:57 a.m., Rui Barradas wrote: Hello, Clean R 3.6.1 session on Ubuntu 19.04, RStudio 1.1.453. sessionInfo() at the end. That's not what I'd call a "clean session" with all those packages loaded: loaded via a namespace (and not attached): [1] sos_2.0-0 nlme_3.1-140

Re: [Rd] Possible bug in `class<-` when a class-specific '[[.' method is defined

2019-07-15 Thread Rui Barradas
Hello, Clean R 3.6.1 session on Ubuntu 19.04, RStudio 1.1.453. sessionInfo() at the end. I can reproduce this. counttt <- 0 `[[.MYCLASS` = function(x, ...) { counttt <<- counttt + 1 # browser() x = NextMethod() return(x) } df <- as.data.frame(matrix(1:20, nrow=5)) class(df) <- c("MY

Re: [Rd] Possible bug in `class<-` when a class-specific '[[.' method is defined

2019-07-15 Thread Duncan Murdoch
On 07/07/2019 11:49 a.m., Ghiggi Gionata wrote: Hi all ! I noticed a strange behaviour of the function `class<-` when a class-specific '[[.' method is defined. Here below a reproducible example : #---. counttt <- 0 `[[.MYCLASS

Re: [Rd] Possible bug in `class<-` when a class-specific '[[.' method is defined

2019-07-15 Thread Michael Lawrence via R-devel
I'm unable to reproduce this with R 3.6.1. Which version are you using? Is this a fresh session? On Mon, Jul 15, 2019 at 3:25 AM Ghiggi Gionata wrote: > > Hi all ! > > I noticed a strange behaviour of the function `class<-` when a class-specific > '[[.' method is defined. > > Here below a reprod

[Rd] Possible bug in `class<-` when a class-specific '[[.' method is defined

2019-07-15 Thread Ghiggi Gionata
Hi all ! I noticed a strange behaviour of the function `class<-` when a class-specific '[[.' method is defined. Here below a reproducible example : #---. counttt <- 0 `[[.MYCLASS` = function(x, ...) { counttt <<- counttt + 1