title: Rename columns of dataframe by adding a prefix -in R
body: <p>I want to rename all columns of my dataframe (expect id and t) by adding the prefix &quot;le_&quot;.
  Firstly I turn the data frame from wide to long format and after specifying the columns ( named 1 - 27) I want to rename them as le_1 - le_27. Any suggestions on how to do this?
  I tried with rename but I got stuck.</p>
  <pre><code>df_long_le &lt;- df_wide_le %&gt;%      
    pivot_longer(cols = starts_with(&quot;le_&quot;), names_to = c( &quot;t&quot;, &quot;.value&quot;), 
    names_pattern = &quot;le_(.*)_(.*)&quot;) %&gt;%
    rename(df_long_le[3:29] = &quot;le_*[1-27]&quot;)
  </code></pre>
  <p>Thank you!</p>
  <p>This is how the dataframe looks like
  <a href="https://i.stack.imgur.com/72gpX.png" rel="nofollow noreferrer">enter image description here</a></p>