'R: Importing different excel file and rename colums in a loop

I am struggeling in writing a code to import different files (selecting and renaming columns) with a loop.

In detail, I am looking for an efficient way to create a loop that does the same as follows for several .xlsx files.

library(readxl)
Data <-read_excel('File.xlsx', sheet = "results", range = cell_cols("B:D"),
                   c("Col1", "Col2", "Col3"))

I have done several attemps, but non of them worked; can anyone suggest a solution?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source