title: Plot multiple graphs from loop with string name
body: <p>I'm working with a large dataset set and I would like to plot several plots. My data looks likes this </p>
  
  <pre><code>SessionID &lt;- (Results-C1-P11-D0 ,  Results-CP0.9-P11-D0, Results-CP0.95-P11-D0, Results-C1-P22-D0 ,  Results-CP0.9-P22-D0, Results-CP0.95-P22-D0, Results-C1-P22-D2 ,  Results-CP0.9-P22-D2, Results-CP0.95-P22-D2 )
  Costs &lt;- (10, 20, 30, 40, 50, 60, 70, 80, 90) 
  </code></pre>
  
  <p>In reality the SessionID contain information on the parameters used for the calculation of the result, i.e. C is the capacity so C1 actually means C=1). 
  I would like to create plots from this data: on the X-axis I would like to plot the parameter C and on the y-axis the Costs only for the results of P=11 and P=22 where D=0. And than the same plot for D=2. </p>
  
  <p>So far I have tried to split the string of the session with the help of this <a href="https://stackoverflow.com/questions/17215789/extract-a-substring-in-r-according-to-a-pattern">here</a> and <a href="https://stackoverflow.com/questions/4350440/split-a-column-of-a-data-frame-to-multiple-columns">here</a>, but I don't know what the most efficient way is to split the information of the SessionID since I ultimately want to come up with a plot that is looped over the different parameters like is done <a href="http://www.reed.edu/data-at-reed/resources/R/loops_with_ggplot2.html" rel="nofollow noreferrer">here</a> (as I said I have a large data set with many parameters).</p>