title: How to output multiple pdf files from many data frame in a for loop in R
body: <p><br/>
  I through <code>assign()</code> function to name many data frame.<br/>
  Use this script:</p>
  
  <pre><code>&gt; for (i in 1:15)
  {
    assign(paste0('TagIDNum',i),filter(Ordf,Ordf$TagID==i))
  }
  </code></pre>
  
  <p>Got this 15 data frame
  <a href="https://i.stack.imgur.com/ES1Pa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ES1Pa.png" alt="enter image description here"></a></p>
  
  <p>Next step I need to output scatterplot of these 15 data frames with <code>pairs()</code> function and <code>for loop</code> to output pdf in once.<br/>
  Here is my script:</p>
  
  <pre><code> for (i in 1:15)
  {
  
    pdf(paste('TagPlotNum',j,'.pdf',sep=''))
    x&lt;-paste('TagIDNum',j,sep='')
    print(pairs(~x[,11]+x[,38]+x[,39]+x[,40]+x[,41]+x[,43]))
    dev.off()
  }
  </code></pre>
  
  <p>But I got this error information
  <a href="https://i.stack.imgur.com/KudbU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KudbU.png" alt="enter image description here"></a></p>
  
  <p>Error information: incorrect number of dimensions<br/>
  And I found that the <code>x</code> had no data, just a <code>value</code> as follow:
  <a href="https://i.stack.imgur.com/xs5CG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xs5CG.png" alt="enter image description here"></a></p>
  
  <p>I will do some analysis in next steps, so this problem disturb for 2 days.<br/>
  Post this article to ask any expert to solve this issue.<br/>
  In my opinion, maybe <code>paste()</code> function have something to think, but I don't know how to solve this topic.<br/>
  Here is my R information:<br/>
  <a href="https://i.stack.imgur.com/MArZi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MArZi.png" alt="enter image description here"></a></p>
  
  <p>Thanks.</p>