I am importing multiple excel sheets into r. Each sheet has a different title in cell a1 above row headers. In r I would like to cut this, promote headers, and then use cut title as row value in a new id column. E.g. I want to turn table a below into table b.
table a
| football | |
| rank | team |
| -------- | -------------- |
| 1 | A |
| 2 | B |
table b
| rank | team |id |
| -------- | -------------- |-----------
| 1 | A |football |
| 2 | B |football |
Can you suggest code for this operation that I can apply in function for every sheet?