title: Convert age entered as 'X Weeks, Y Days, Z hours' in R
body: <p>I have an age variable containing observations that follow this (inconsistent) format:</p>
  
  <pre><code>3 weeks, 2 days, 4 hours
  4 weeks, 6 days, 12 hours
  3 days, 18 hours
  4 days, 3 hours
  7 hours
  8 hours
  </code></pre>
  
  <p>I need to convert each observation to hours using R.  </p>
  
  <p>I have used <code>strsplit(vector, ',')</code> to split the variable at each comma. </p>
  
  <p>I am running trouble because splitting each observation at the ',' yields anywhere from 1 to 3 entries for each observation. I do not know how to properly index these entries so that I end up with one row for each observation.</p>
  
  <p>I am guessing that once I am able to store these values in sensible rows, I can extract the numeric data from each column in a row and convert accordingly, then sum the entire row.</p>
  
  <p>I am also open to any different methods of approaching this problem.</p>