Below you can see my function that imports data from different types of Excel sheets.
library(dplyr)
library(readxl)
library(data.table)
library(purrr)
library(tidyr)
read_excel_allsheets <- function(filename) {
sheets <- readxl::excel_sheets(filename)
x <- lapply(sheets, function(X) readxl::read_excel(filename, sheet = X))
names(x) <- sheets
x
}
files <- list.files(path = "C:/Data",
pattern = "*.xlsx",
full.names = TRUE)
imported_templates <- lapply(files, read_excel_allsheets)
names(imported_templates) <- basename(files)
When I imported data from Excel sheets I receive a message like the message below: New names:
* `` -> ...4
* `` -> ...5
* `` -> ...7
* `` -> ...8
* `` -> ...10
* ...
This is very boring because I need to import around 1000 tables. I tried to turn off this message with this line of code but the message is still here.
library(readxl, warn.conflicts=FALSE)
So can anybody help me how to solve this problem and turn off this warning?