title: How to sum numeric values in a character vector?
body: <p>I have a data frame with rows containing several numbers in each row. The data type of each column in the data frame is <code>factor</code>. </p>
  
  <p>My data frame looks like</p>
  
  <pre><code>&gt; df
             C1
  1 1, 14, 1, 4
  2           2
  3          NA
  4     3, 7, 5
  </code></pre>
  
  <p>Now I want to sum up the values of each element in <code>df</code>. Such that I get</p>
  
  <pre><code>  Sum
  1  20
  2   2
  3  NA
  4  15
  </code></pre>
  
  <p>I tried <code>strsplit(as.character(df$C1),split=",")</code>. However I have no idea how to build get the sum...</p>
  
  <pre><code>df &lt;- data.frame(C1= c("1, 14, 1, 4", "2", NA, "3, 7, 5"))
  </code></pre>