title: Cut and labels/breaks length conflict
body: <p>I am working with the cut function to prep data for a barplot histogram but keep running into a seeming inconsistency between my labels and breaks:</p>
  
  <p><code>Error in cut.default(sample(1:1e+05, 500, T), breaks = sq, labels = sprintf("$%.0f",  : 
    labels/breaks length conflict</code></p>
  
  <p>Here is an example. I pretend that it is income data, using a sequence of 0 to $100,000 in bins of $10,000. I use the same variable to generate both breaks and labels, with minor formating on the label side. I thought they might for some reason have different lengths when comparing to a character vector, but they appear to have the same length, still.</p>
  
  <pre><code>&gt; sq&lt;-seq(0,100000,10000)
  &gt; cut(sample(1:100000, 500, T),breaks=sq,labels=sprintf("$%.0f",sq))
  &gt; length(sprintf("$%.0f",sq))
  [1] [11]
  &gt; length(sq)
  [1] [11]
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Per @thelatemail and @Josh O'Brien's suggestions, I changed the code to this and things are in working order. 
  <code>cut(sample(1:100000, 500, T),breaks=sq,labels=sprintf("$%.0f",sq[-1]))</code></p>