data.frame issue

I can't tell without a reprex (see the FAQ) to be able to run the code. What you can do is to save the before header row with

header <- colnames(your_data)

and then

colnames(your_new_data) <- header