I can't perform a simple loop that stores the column names and their types.
I mean, I just want to iterate over a list of files inside a folder.
For each file, I want to store the glimpse() information in order to compare all the datasets I have according to their types and names.
I wrote something like this:
map_df(file_list, data.table::fread, dec = ",") %>% capture.output(glimpse(.), file = "column_info.txt", append = TRUE)
I use fread because the files are in CSV format.
That is, I use data.table::fread to open them and then run the glimpse() function.
I even tried:
map_df(file_list, ~ fread(.x) %>% summarise_all(list(nombre = names(.), tipo = class(.))), .id = "id")
But it fails. If I just run until the fread syntax, it works flawlessly.
I hope I explained the issue well.
Thanks for your help and time, community.
Have a nice weekend.