We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
this code
library(R6) R6_matrix <- R6::R6Class( "R6_matrix", portable=FALSE, public=list( data_=matrix(0,0,0), data=function(){return(self$data_)}, initialize=function(nrow,ncol,val){ self$data_ <- matrix(val,nrow,ncol) }, `[`=function(row,col){ return(self$data_[row,col]) }, `[<-`=function(row,col,value){ self$data_[row,col] <- value invisible(self) } ) ) `[.R6_matrix` <- function(obj,...) obj$`[`(...) `[<-.R6_matrix` <- function(obj,...) obj$`[<-`(...) x <- R6_matrix$new(5,5,4) x[1,1] x[1,1] <- 2
throws an error
> x[1,1] Error in self$data_[row, col] (from #12) : unused argument (col) > x[1,1] <- 2 Error in `[<-`(`*tmp*`, row, col, value = 2) (from #15) : unused argument (col) >
which can only be avoid by setting portable=TRUE
portable=TRUE
Is this a bug or an unavoidable limitation of the operator overloading in R6?
Thank you!!
ND: OS: Linux, kernel 6.12 R: 4.4.2 R6: 2.5.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
this code
throws an error
which can only be avoid by setting
portable=TRUE
Is this a bug or an unavoidable limitation of the operator overloading in R6?
Thank you!!
ND:
OS: Linux, kernel 6.12
R: 4.4.2
R6: 2.5.1
The text was updated successfully, but these errors were encountered: