What are .dta files and can we read them into R

r
stata_files

#1

Hello,

I recently came upon some data and intend to use it for some analysis.The data is in .dta format.It seems that it is Stata data.
What kind of file is this and how do i read it in R?Is there any package in R to do that?


#2

Hi @data_hacks,

Yes .dta files are Stata files and there is package called “foreign” in R which has to be installed for reading these files.
After you run library(foreign) use read.dta just like read.csv is used to read in the .dta file.
Hope this helps!!