title: Error in R S4 setReplaceMethod
body: <p>I am trying to define the [&lt;- function for my own class following the example in this tutorial <a href="http://cran.r-project.org/doc/contrib/Genolini-S4tutorialV0-5en.pdf" rel="nofollow">http://cran.r-project.org/doc/contrib/Genolini-S4tutorialV0-5en.pdf</a> (page 37)</p>
  
  <p>However, no matter how hard i try, I always get strange error:</p>
  
  <pre><code>setClass(Class = "A",
       representation = representation(x = "numeric"),
       prototype = prototype(x = 0))
  
  setReplaceMethod(f = "[",
               signature = "A",
               definition = function(object, i, j, value) {
                   return(object)
               })
  
  Error in conformMethod(signature, mnames, fnames, f, fdef, definition) : 
    in method for '[&lt;-' with signature 'x="A"': formal arguments (x = "A", i = "A", j = "A", value = "A") 
  omitted in the method definition cannot be in the signature
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>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 '[&lt;-' with signature 'x="A"': formal arguments (x = "A", i = "A", j = "A", value = "A") 
  omitted in the method definition cannot be in the signature
  </code></pre>
  
  <p>Any idea why is this?</p>