Fastest way of loading Stata dataset in R
In this run-time test, I compare three R packages for loading Stata datasets which are foreign, haven, and readstata13. For the test, I used a Stata dataset which has 3,300,000 observations, about 200 MB.
The readstata13 package seems to be the best option for reading Stata datasets in R, and it also supports Stata 13 and 14 (similar to haven). The foreign package is the slowest, and the haven package is somehow close to readstata13.
This test also shows that the difference only appears in large dataset and for a daily use, either of the packages is good enough!
Filed under Uncategorized
Search