title: R write dataframe column to csv having leading zeroes
body: <p>I have a table that stores prefixes of different lengths..
  snippet of table(ClusterTable)</p>
  
  <blockquote>
    <p>ClusterTable[ClusterTable$FeatureIndex == "Prefix2",'FeatureIndex',
    'FeatureValue')]</p>
  </blockquote>
  
  <pre><code>   FeatureIndex FeatureValue
  80      Prefix2           80
  81      Prefix2           81
  30      Prefix2           30
  70      Prefix2           70
  51      Prefix2           51
  84      Prefix2           84
  01      Prefix2           01
  63      Prefix2           63
  28      Prefix2           28
  26      Prefix2           26
  65      Prefix2           65
  75      Prefix2           75
  </code></pre>
  
  <p>and I write to csv file using following:</p>
  
  <pre><code>write.csv(ClusterTable, file = "My_Clusters.csv")
  </code></pre>
  
  <p>The Feature Value 01 loses it leading zero.</p>
  
  <p>I tried first converting the column to characters</p>
  
  <pre><code>ClusterTable$FeatureValue &lt;- as.character(ClusterTable$FeatureValue)
  </code></pre>
  
  <p>and also tried to append it to an empty string to convert it to string before writing to file.</p>
  
  <pre><code>ClusterTable$FeatureValue &lt;- paste("",ClusterTable$FeatureValue)
  </code></pre>
  
  <p>Also, I have in this table prefixes of various lengths, so I cant use simple format specifier of a fixed length. i.e the table also has Value 001(Prefix3),0001(Prefix4),etc.
  Thanks</p>