search for: myreplacementfunct

Displaying 2 results from an estimated 2 matches for "myreplacementfunct".

2018 Oct 15
4
sys.call() inside replacement functions incorrectly returns *tmp*
Kia Ora Let's say we have: "myreplacementfunction<-" = function (..., value) { call = sys.call () print (as.list (call) ) 0 } Then we call: x = 0 myreplacementfunction (x, y, z) = 0 It will return: [[1]] `myreplacementfunction<-` [[2]] `*tmp*` [[3]] y [[4]] z $value <promise: 0x06fb6968> There's two problems here....
2018 Oct 15
0
sys.call() inside replacement functions incorrectly returns *tmp*
...ing it? Also, I have to say that your example looks confusing to me. Do you want to assign 0 to x, and ignore all other arguments? Or was it your intention to set all variables to 0? And having an ellipsis argument only makes sense in my experience if these arguments are optional. Which would mean myreplacementfunction() = 0 should be a valid call, but I can't see what that would be expected to do. So I would at least make the call `myreplacementfunction(x, ..., value). The reason y and z are "right" is because these are simple extra input parameters, which can have any value, including missing,...