title: R - getting back single element from strsplit
body: <p>I have a character vector separated by "_".  I want to loop through each string split it and then use the individual values to grab specific rows/cols of a csv file to do some calculations.  How can I get the individual elements?    </p>
  
  <pre><code>tst &lt;- c("Test1_Test2","Test3_Test4")
  
  splt &lt;- strsplit(tst,"_")
  splt
  
  [[1]]
  [1] "Test1" "Test2"
  
  [[2]]
  [1] "Test3" "Test4"
  </code></pre>
  
  <p>How can I get the single value into a variable? i.e.</p>
  
  <pre><code>str1 &lt;- "Test1"
  str2 &lt;- "Test2"
  str3 &lt;- "Test3"
  str4 &lt;- "Test4"
  </code></pre>
  
  <p>Edit:  I always figure it out right after I post the question lol.  </p>
  
  <pre><code>splt[[1]][1]
  [1] "Test1"
  </code></pre>