title: Subset dataframe based on factor levels starting with specific character or string of characters
body: <p>I am trying to subset a dataframe based on a factor (here, ID).
  What I would like is to subset based on factor levels starting with a specific character.
  Here is an example dataframe:</p>
  
  <pre><code>ID = c("100", "100a", "101", "103", "204", "206", "207", "207a", "207b") # ID is a factor
  Value = rnorm(9)
  df = data.frame(ID, Value) 
  </code></pre>
  
  <p>I would like to end up with two separate dataframes, one with ID starting with "1" and one with ID starting with "2". My dataframe is much longer than the one provided, I can thus not subset based on a list of factor levels.
  <a href="https://stackoverflow.com/questions/28060621/subset-based-on-first-three-numbers">Here it was done with a continuous variable</a>, but I haven't found an example with factors.</p>
  
  <p>Thank you for your help!</p>