title: How to Split Dataset and plot in R
body: <p>I am using a data set like:</p>
  <pre><code>1  48434  14566
  1  56711  6289
  1  58826  4174
  2  56626  6374
  2  58888  4112
  2  59549  3451
  2  60020  2980
  2  60468  2532
  3  56586  6414
  3  58691  4309
  3  59360  3640
  3  59941  3059
  .
  .
  .
  10  56757  6243
  10  58895  4105
  10  59565  3435
  10  60120  2880
  10  60634  2366
  </code></pre>
  <p>I need a plot in R of 3rd column for each value of first column i.e. for above data there would be 10 different plots of (each group 1-10) of values of 3rd column. x-axis is number of Iterations and Y-axis is the values with max 63000. I also need to connect the dots with a line in color red.
  I am new to R and have been reading documentation but that confused me more. could any body plz help.</p>
  <p><strong>EDIT: I actually want line graph of V3 values. the number of rows of v3 column would be on x-axis and v3 values on y-axis. And I want different graphs each for a group indicated by v1. Chase's solution works except that I want the axis shifted, the V3 values should be on y-axis.here is example</strong>
  <img src="https://i.stack.imgur.com/Jf0ZX.jpg" alt="alt text" /></p>
  <p><strong>EDIT2: @Roman, Here is the code I am executing.</strong></p>
  <pre><code>library(lattice)
  d &lt;- read.delim(&quot;c:\\proj58\\positions23.txt&quot;,sep=&quot;&quot;)
  d &lt;- do.call(rbind, lapply(split(d, d$V1), function(x) {
      x$iterations &lt;- order(x$V3, decreasing=TRUE)
      x
  }))
  xyplot(V3 ~ iterations | V1, type=&quot;l&quot;, data=d)
  </code></pre>
  <p><strong>This is the error I get,</strong></p>
  <pre><code>    &gt; 
  &gt;  source(&quot;C:\\proj58\\plots2.R&quot;)
  &gt; d
         V1    V2    V3 iterations
  1.1     1 48434 14566          1
  1.2     1 56711  6289          2
  1.3     1 58826  4174          3
  1.4     1 59528  3472          4
  </code></pre>
  <p><strong>I am not getting any plot?? what am I missing</strong>
  OK: Got It. don't know what was wrong. Here it is,</p>
  <p><img src="https://i.stack.imgur.com/kkncM.jpg" alt="alt text" /></p>
  <p>2 more things, how to change V1 labels on the boxes to actual numbers like 1,2,...
  secondly I have files that contain 100 groups, I tried one and it made all graphs on a single page (unreadable obviously), can I make these on more than one windows?</p>