title: In R, how can I extend generic methods from one package in another?
body: <p>I have a package <code>PackageA</code> with a generic function: </p>
  
  <pre><code>#' doWork
  #' 
  #' Do some work!
  #'
  #' @export
  setGeneric(
      "doWork", 
      function(x) {
  
          standardGeneric("doWork")
      })
  
  setMethod(
      "doWork", 
      signature = c("numeric"), 
      definition = function(x) {
  
          x == 10 # Some logic... 
      }
  </code></pre>
  
  <p>In <code>PackageB</code>, which depends on <code>PackageA</code>, I would like to add more methods to <code>doWork</code>: </p>
  
  <pre><code>#' @import PackageA
  setMethod(
      "doWork", 
      signature = c("character"), 
      definition = function(x) {
  
          length(x) == 1 &amp;&amp; x == "10" # Some more logic... 
      }
  </code></pre>
  
  <p>This works. However, it means that the user of <code>PackageB</code> must also <code>library(PackageA)</code>.</p>
  
  <p>This fails: </p>
  
  <pre><code>library(PackageB)
  
  doWork("10") # Fails!
  </code></pre>
  
  <p>This works: </p>
  
  <pre><code>library(PackageA)
  library(PackageB)
  
  doWork("10")
  </code></pre>
  
  <p>I would like to use the generic from <code>PackageA</code> in <code>PackageB</code>, but not require <code>PackageA</code> to be loaded to use just the methods in <code>PackageB</code>. </p>
  
  <p>How can I achieve this? </p>