title: Skipping error in for-loop
body: <p>I am doing a for loop for generating 180 graphs for my 6000 X 180 matrix (1 graph per column), some of the data don't fit my criteria and i get the error:    </p>
  
  <pre><code>"Error in cut.default(x, breaks = bigbreak, include.lowest = T) 
  'breaks' are not unique". 
  </code></pre>
  
  <p>I am fine with the error, I want the program to continue running the for loop, and give me a list of what columns made this error (as a variable containing column names maybe?).</p>
  
  <p>Here's my command:</p>
  
  <pre><code>for (v in 2:180){
      mypath=file.path("C:", "file1", (paste("graph",names(mydata[columnname]), ".pdf", sep="-")))
      pdf(file=mypath)
      mytitle = paste("anything")
      myplotfunction(mydata[,columnnumber]) ## this function is defined previously in the program
      dev.off()
  }
  </code></pre>
  
  <p>Note: I have found numerous posts about tryCatch and none of them worked for me (or at least i couldn't apply the function correctly). The help file wasn't very helpful as well.</p>
  
  <p>Help would be appreciated. Thanks.</p>