Hello,
I've tested this code and It works
library(haven)
library(tidyverse)
statas<-list.files(path = "C:/Users/JB/Downloads",pattern ="^ff-.*\\.dta$",full.names = TRUE)
archives<-map_dfr(statas,read_dta,.id = "source")
The issue is that's useful if I want to loop over each one of the stata files (over 100) in order to retrieve a tabulate as:
archives %>%
group_by(source, var1, var2) %>%
summarise(numbers=n()) %>%
pivot_wider(names_from=c(source,var2),values_from=numbers)
This question is because every stata Filesize is near 200 Mb...Imagine your RAM joining 200 MB files.
Using Stata I just ran a loop to read every dta, and I was never storing the previous one.
What would you do?
I hope I made myself clear.
As always, thanks for your time, interest, and patience