title: R demo() and example() methods?
body: <p>Is there a simple way to check if <code>R functions</code> and <code>packages</code> have <code>demo()</code> and <code>example()</code> methods?</p>
  
  <p>When building a package, does the package need to have the necessary objects so that <code>demo()</code> and <code>example()</code> can be called on it?</p>
  
  <p><strong>Edit:</strong> In trying to answer this, I checked the source code of <code>demo()</code></p>
  
  <pre><code>demo(package = .packages(all.available = TRUE)) # check which packages have demo
  </code></pre>