If you prefer to stick to dplyr pipes in the world, then with dplyr 0.7.2 you can rename by position using the following nomenclature:
Using the original example:
gtbl <- gtbl %>% rename("life_exp" = !!names(.[5]), "gdp_percap" = !!names(.[6]))
Respectfully fishes out an older position. I had a similar problem and considered this question before figuring out this alternative solution.
Harney
source share