title: Knit HTML fails to output upon code error
body: <p>My R script creates a series of matrices and boxplots of those matrixes. It is possible that one of the matrices may be empty. Executing <code>boxplot</code> of an empty matrix gives an error. That is not a problem. The problem is, when running this code in R Markdown to knit an HTML file, this error halts the execution and results in no HTML file. </p>
  
  <p>As a patch, I though to run <code>boxplot</code> only if the matrix is not all NAs. That works. Yet I'd like to know if I could get knitr to simply ignore this error, rather than patch my code. Thank you.</p>
  
  <p>This is the error message:</p>
  
  <pre><code>Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) : 
    need finite 'ylim' values
  Calls: &lt;Anonymous&gt; ... boxplot -&gt; boxplot.default -&gt; do.call -&gt; bxp -&gt; plot.window
  In addition: Warning messages:
  1: In min(x) : no non-missing arguments to min; returning Inf
  2: In max(x) : no non-missing arguments to max; returning -Inf
  Execution halted
  </code></pre>
  
  <p>Reproducible code:</p>
  
  <pre><code>```{r,echo = FALSE, warning = FALSE, message=FALSE}
  knitr::opts_chunk$set(cache=TRUE)
  
  #MatrixPos - not empty
  MatrixPos &lt;- structure(list(difFwd1 = 0, difFwd2 = 0.200000000000045, difFwd3 = 0.100000000000136,difFwd4 = 0, difFwd5 = 0.200000000000045), .Names = c("difFwd1","difFwd2", "difFwd3", "difFwd4", "difFwd5"), row.names = "155", class = "data.frame") 
  
  #MatrixNeg - empty
  MatrixNeg &lt;- structure(list(difFwd1 = NA_real_, difFwd2 = NA_real_, difFwd3 = NA_real_,difFwd4 = NA_real_, difFwd5 = NA_real_), .Names = c("difFwd1","difFwd2", "difFwd3", "difFwd4", "difFwd5"), row.names = "NA", class = "data.frame") 
  
  boxplot(MatrixPos, notch = TRUE, outline = TRUE)
  boxplot(MatrixNeg, notch = TRUE, outline = TRUE)
  
  ```
  ###note must remove the four spaces for the code to work in R-Studio
  
  
  #Solution attempt:
  if(!all(is.na(MatrixNeg))) boxplot(MatrixNeg, notch = TRUE, outline = TRUE)
  </code></pre>