title: How can I assign rownames with `<-` while using a pipe `%>%`?
body: <p>We can assign the rownames of a data frame by using the <code>&lt;-</code> operator with <code>rownames(df)</code> as below:</p>
  
  <pre><code>df&lt;-data.frame(a=letters[1:5], b=1:5, c=LETTERS[1:5])
  df
  rownames(df) &lt;- df[,1]
  df[,1] &lt;- NULL
  df
  </code></pre>
  
  <p>Above script will convert the first column to rowname, output as below:  </p>
  
  <pre><code>df
    a b c
  1 a 1 A
  2 b 2 B
  3 c 3 C
  4 d 4 D
  5 e 5 E
  
  df
    b c
  a 1 A
  b 2 B
  c 3 C
  d 4 D
  e 5 E 
  </code></pre>
  
  <p>Is there a way to use pipe <code>%&gt;%</code> to do it?  </p>
  
  <p>I tried <code>df %&gt;% rownames(.) &lt;- .[,1]</code> but failed.<br>
  The key issue is cannot use <code>&lt;-</code> between <code>%&gt;%</code></p>