title: return value of library(.) command in R
body: <p>In R when you want to load a library, call one foo for example, the command is</p>
  
  <pre><code>library(foo)
  </code></pre>
  
  <p>Is there a return value for this call indicating success/failure?  I would like to use as follows</p>
  
  <pre><code>if library(foo) != 1:
      install.packages("foo")
  </code></pre>
  
  <p>thx </p>