I have a class 'myClass' in R that is essentially a list. It has an assignment operator which is going to do some things and then should assign the value using the regular list assignment operator
`$<-.myClass`<-function(x,i,value){
# do some pre-processing stuff
# make the assignment using the default list assignment
x[[i]]<-value
x
}
But I can't actually use x[[i]]<-value
as it will dispatch to the already existing [[<-.myClass
method.
In similar S3 dispatching cases, I've been able use UseMethod
or specifically call [[<-.list
, or [[<-.default
but those don't seem to exist because $<-
and [[<-
are primitive generics, right? And I'm sure I'll be sent to a special R hell if I try to call .Primitive("$<-")
. What is the correct way to dispatch the assignment to the default assignment method?