title: How to automatically find that package installation fails?
body: <p>I would like to install old package from mran snapshot. I am using this command: </p>
  
  <pre><code>tryCatch({
    resp &lt;- install.packages(pkgs = "https://cran.microsoft.com/snapshot/2016-12-05/bin/windows/contrib/3.4/car_2.1-4.zip", 
                             repos = NULL, 
                             dependencies = FALSE, 
                             type = "win.binary")
  },
  warning = function(e) {
    print("ITERATE - WARNING")
  },
  error = function(e) {
    print("ITERATE - ERROR")
  })
  </code></pre>
  
  <p>I know that I can use packages like versions or devtools. tryCatch is here not by mistake. The question is if I can try/catch it somehow?</p>
  
  <p>I know that I can check if url exists before or even download file like that:</p>
  
  <pre><code>tryCatch({
    download.file("https://cran.microsoft.com/snapshot/2016-12-05/bin/windows/contrib/3.4/car_2.1-4.zip", destfile = "car_2.1-4.zip")
  },
  error = function(e) {
    print("ITERATE - ERROR")
  })
  </code></pre>
  
  <p>But it is not solution which I am looking for. I would like to identify that this function fails and then handle it somehow.</p>
  
  <blockquote>
    <p>install.packages()</p>
  </blockquote>
  
  <p>Can somebody give me some tips?</p>