title: What does the r function requirenamespace() mean?
body: <p>Every package installation instruction starts with:</p>
  <pre><code>if (!requireNamespace(&quot;BiocManager&quot;, quietly = TRUE))
    install.packages(&quot;BiocManager&quot;)
  </code></pre>
  <p>I was wondering what the <code>requireNamespace()</code> function means?</p>
  <p>The definition given in the documentation doesn't make much sense to me. How is <code>requireNamespace()</code> different to <code>loadNamespace</code>?</p>
  <blockquote>
  <p>a wrapper for loadNamespace analogous to require that returns a logical value&quot;</p>
  </blockquote>
  <p>And are the following two lines always necessary to precede each new package installation?</p>
  <pre><code>if (!requireNamespace(&quot;BiocManager&quot;, quietly = TRUE))
    install.packages(&quot;BiocManager&quot;)
  </code></pre>