title: Replace column name with another column item name and delete columns every 6 column in loop
body: <p>I have following data: in R, I want to replace column name hits with "advertising"<br>
  which is an element of column keyword.I want to do this process in repetition for 100 columns. Once this process is complete. I want to delete every six columns (after hits) for 100 columns.</p>
  
  <p>Here is reproducible code for the data sample given below;</p>
  
  <pre><code>hits&lt;- c(89, 93, 97, 86, 82, 83, 84, 76, 87, 87) geo &lt;- c("ca","ca","ca","ca","ca","ca","ca","ca","ca","ca") time&lt;- c("all","all","all","all","all","all","all","all","all","all") 
  keyword&lt;- c("adver","adver","adver","adver","adver","adver","adver","adver","adver","adver"
  ) 
  group&lt;- c("web","web","web","web","web","web","web","web","web","web") 
  category&lt;- c(12,12,12,12,12,12,12,12,12,12) subject1 &lt;- list(hits = hits,geo = geo,time = time, keyword = keyword, group = group) pt_data &lt;- data.frame(subject1, hits, geo,time, keyword, group, category, stringsAsFactors = FALSE)
  </code></pre>
  
  <hr>
  
  <p>I want if we change the column name "hits" with adver which is item in column "keyword", this process shall repeat for 100 columns or so.
  then delete columns, geo,time,keyword,and group repatedly for 100 columns or so.
  Please note that hits,geo, time,keyword,group,category, are repeating again starting from hits,...……..</p>
  
  <p><img src="https://i.stack.imgur.com/4NfXh.png" alt="data sample is attached here"></p>