title: Count each occurrence of each element in a string
body: <p>I would like to count occurrences for each single character in a string and output them to a dataframe.</p>
  
  <p>Here is my try:</p>
  
  <pre><code>q.data&lt;-data.frame(number=1,string=c("COUNTTHESECHARACTERS"))
  q.data[,3]&lt;-string.counter(strings=q.data$string, pattern="A")
  q.data[,3]&lt;-string.counter(strings=q.data$string, pattern="B")
  </code></pre>
  
  <p>And I would like to get output similar to this:</p>
  
  <pre><code>x &lt;- c("string","C","O","U","...")
  colnames(df) &lt;- x
  df[1,] &lt;- c("COUNTTHESECHARACTERS","3","1","1","...")
  df
  </code></pre>