What is setReplaceMethod() and how does it work?
问题 I'm confused about the usage of setReplaceMethod() . Looking at ?setReplaceMethod does not provide an explanation and Googling is less than helpful. QUESTION : Please explain setReplaceMethod() , it's usage and how it works (preferably with an example). 回答1: Here is what I found. As pointed by @Hong Ooi in the comments setReplaceMethod("fun") is the same as setMethod("fun<-") , so setReplaceMethod is used to create a method for a generic replacement function in the S4 object system of R. What