I have the following code in R that combines multiple (177) csv files. However in a lot of the files, some column names have spaces and the others have underscores as separators e.g 'Article Number' and 'Article_Number'. I have tried janitor::make_clean_names and make.names etc within the code but I just cannot figure out the correct way to do it.
Any help much appreciated
df <- list_of_files %>%
set_names() %>%
map_dfr(
~read_csv(.x, col_types = cols(.default = "c", 'TY Stock Value' = "c"), col_names = TRUE,),
.id = "file_name"
)