title: How can I subset my data into intervals
body: <p>I'm new to <code>R</code> and I'm trying to get my script more efficient. I have a <code>data.frame</code> of  <code>25480</code> observations and <code>17</code> variables.</p>
  
  <p>One of my variables is <code>Subject</code> and each subject has its number. However, the number of observations (<code>lines</code>) for each subject is not equal.  I would like to separate my <code>subjects</code> into <code>groups</code>, according to their number. How can I do it?</p>
  
  <p>Before I used this formula: </p>
  
  <pre><code>gaze &lt;- subset(gaze, Subject != "261" &amp; Subject != "270" &amp; Subject != "275") 
  </code></pre>
  
  <p>But now I have too many subjects to repeat Subject each time. Is it possible to define interval of subjects to <code>cut</code> or to <code>split</code>. I tried this command but it doesn’t seem to work: </p>
  
  <pre><code>gazeS &lt;- (gaze$Subject[112:216])
  cut(gaze, seq(gaze, from = 112, to = 116))
  </code></pre>
  
  <p>Could you help me to fix this code, please?</p>