title: R - creating data frames inside a for loop
body: <p>I have hardcoded this:</p>
  
  <pre><code>s79t5 &lt;- read.csv("filename1.csv", header = TRUE)
  s81t2 &lt;- read.csv("filename2.csv", header = TRUE)
  etc.
  
  subsets79t5 &lt;- subset(s79t5, Tags!='')
  subsets81t2 &lt;- subset(s81t2, Tags!='')
  ...
  subsets100t5 &lt;- subset(s100t5, Tags!='')
  </code></pre>
  
  <p>now i need to softcode it. i am almost there:</p>
  
  <pre><code>sessions &lt;- c('s79t5', 's81t2', 's88t2', 's90t3', 's96t3', 's98t4', 's100t5')
  
  for (i in 1:length(sessions)) {
      jFileName &lt;- c(as.character(sessions[i]))
      j &lt;- data.frame(jFileName)
      subset &lt;- subset(j, j$Tags!='')
      assign(paste("subset", jFileName, sep = ""), data.frame(subset))
  }
  </code></pre>