title: Convert integer to words
body: <p>For the purpose of styling data visualizations, I'd like to be able to display an integer using words (e.g. </p>
  
  <blockquote>
    <p>"Two thousand and seventeen"</p>
  </blockquote>
  
  <p>) rather than digits (e.g. <code>2017</code>).</p>
  
  <p>As an example of what I'm looking for, here's a quick function that works for a small, scalar integer:</p>
  
  <pre><code>int_to_words &lt;- function(x) {
  
                     index &lt;- as.integer(x) + 1
                     words &lt;- c('zero', 'one', 'two', 'three', 'four',
                                'five', 'six', 'seven', 'eight', 'nine',
                                'ten')
                     words[index]
  }
  
  
  int_to_words(5)
  </code></pre>