title: Subset a data frame based on column entry (or rank)
body: <p>I have a data.frame as simple as this one:</p>
  
  <pre><code>id group idu  value
  1  1     1_1  34
  2  1     2_1  23
  3  1     3_1  67
  4  2     4_2  6
  5  2     5_2  24
  6  2     6_2  45
  1  3     1_3  34
  2  3     2_3  67
  3  3     3_3  76
  </code></pre>
  
  <p>from where I want to retrieve a subset with the first entries of each group; something like:</p>
  
  <pre><code>id group idu value
  1  1     1_1 34
  4  2     4_2 6
  1  3     1_3 34
  </code></pre>
  
  <p>id is not unique so the approach should not rely on it.</p>
  
  <p>Can I achieve this avoiding loops?</p>
  
  <p><code>dput()</code> of data:</p>
  
  <pre><code>structure(list(id = c(1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L), group = c(1L, 
  1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L), idu = structure(c(1L, 3L, 5L, 
  7L, 8L, 9L, 2L, 4L, 6L), .Label = c("1_1", "1_3", "2_1", "2_3", 
  "3_1", "3_3", "4_2", "5_2", "6_2"), class = "factor"), value = c(34L, 
  23L, 67L, 6L, 24L, 45L, 34L, 67L, 76L)), .Names = c("id", "group", 
  "idu", "value"), class = "data.frame", row.names = c(NA, -9L))
  </code></pre>