title: To chronologically sort rows in group of 4 in r dataframe
body: <p>i have a data frame with first column as id and second column as date . other 3 columns contains some other random values.</p>
  
  <p>size of data frame = 5 columns and 160000 rows.</p>
  
  <p>I want to sort the first 4 records based on chronological order of date against those records in second column.
  oldest record among 4 should come first and latest record should come last.
  After this i have to go on sorting next all rows in group of 4.</p>
  
  <pre><code>ID  Date        A   B   C   
  X   10/27/2011  12  47  78
  Y   09/28/2015  27  14  41
  Z   01/14/2013  24  25  45
  W   04/21/2005  14  74  21
  -
  -
  -
  -
  upto 160000 rows
  
  
  
   output
  
      ID  Date        A   B   C
      W   04/21/2005  14  74  21
      X   10/27/2011  12  47  78
      Z   01/14/2013  24  25  45
      Y   09/28/2015  27  14  41
  
  -
  -
  -
  upto 160000 rows
  </code></pre>
  
  <p>any way to do this? </p>
  
  <p>I am using this as of now but unable to split this into groups for 4 rows</p>
  
  <pre><code>d[order(as.Date(d$df, format="%d/%m/%Y")),]
  </code></pre>
  
  <p>the data type of column is integer. and i am trying to read it as date.</p>
  
  <p>Thanks</p>