title: Renaming columns based on condition about other columns (Rstudio)
body: <p>When I upload my xlsx dataset the columns like that :</p>
  <p><a href="https://i.stack.imgur.com/poeOb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/poeOb.png" alt="enter image description here" /></a></p>
  <p>It becomes like that in R :</p>
  <p><a href="https://i.stack.imgur.com/OAbD0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OAbD0.png" alt="enter image description here" /></a></p>
  <p>Thus I want to replace the X... pattern with the name of the column just before and add a IR at the end</p>
  <p>I have this for now :</p>
  <pre><code>data9_1 %&gt;%
     rename_at(vars(starts_with(&quot;X&quot;)), ~ str_c(.,&quot;IR&quot;)) 
  </code></pre>
  <p>But I don't know how to place the condition with the column before ?</p>
  <p>thank you</p>