title: Remove the last dummy of a character or factor variable in R
body: <p>I borrowed a little example from <a href="https://stackoverflow.com/questions/11952706">here</a></p>
  <pre><code>df &lt;- data.frame(letter = rep(c('a', 'b', 'c'), each = 2), y = 1:6)
  library(caret)
  dummy &lt;- dummyVars(~ ., data = df, fullRank = TRUE, sep = &quot;_&quot;)
  head(predict(dummy, df))
  
  ##    letter_b letter_c y
  ##  1        0        0 1
  ##  2        0        0 2
  ##  3        1        0 3
  ##  4        1        0 4
  ##  5        0        1 5
  ##  6        0        1 6
  </code></pre>
  <p>However, it gives a dataframe where the first dummy  of  the  factor variable <code>letter_a</code> is removed.</p>
  <p>I also have tried the <code>fastDummies::dummy_cols</code> as follows:</p>
  <pre><code>head(fastDummies::dummy_cols(df, remove_selected_columns=TRUE, remove_first_dummy=TRUE))
  
      ##     y letter_b letter_c
  ##  1  1        0        0
  ##  2  2        0        0
  ##  3  3        1        0
  ##  4  4        1        0
  ##  5  5        0        1
  ##  6  6        0        1
  </code></pre>
  <p>but it only has a <code>remove_first_dummy=TRUE</code> argument with also removing <code>letter_a</code>. How can one remove the last dummy of the factor variable <code>letter_c</code> in R in a concise and convenient way?</p>