R S4 setreplace方法中存在错误
我试图在重载方法的定义中定义S4中的[参数名称必须与原始方法的名称完全匹配R S4 setreplace方法中存在错误,r,methods,s4,R,Methods,S4,我试图在重载方法的定义中定义S4中的[参数名称必须与原始方法的名称完全匹配 setReplaceMethod(f="[", signature="A", function(x, i, j, ..., value){return(x)}) 注意x(您使用了对象。请参见getGeneric(“[ setClass(Class = "A", representation = representation(x = "numeric"), prototype = prototype(
setReplaceMethod(f="[", signature="A", function(x, i, j, ..., value){return(x)})
注意x
(您使用了对象
。请参见getGeneric(“[
setClass(Class = "A",
representation = representation(x = "numeric"),
prototype = prototype(x = 0))
setReplaceMethod(f = "[",
signature = signature("A", "integer", "integer", "numeric"),
definition = function(object, i, j, value) {
return(object)
})
Error in conformMethod(signature, mnames, fnames, f, fdef, definition) :
in method for '[<-' with signature 'x="A"': formal arguments (x = "A", i = "A", j = "A", value = "A")
omitted in the method definition cannot be in the signature
setReplaceMethod(f="[", signature="A", function(x, i, j, ..., value){return(x)})