HertieDataScience / SyllabusAndLectures

Hertie School of Governance Introduction to Collaborative Social Science Data Analysis
MIT License
37 stars 60 forks source link

How to import Stata file into R #89

Open mujahedulislam opened 8 years ago

mujahedulislam commented 8 years ago

Dear Friends,

The following command will help you to import Excel file into R. I really spent good time so I do not want to repeat it for you!.:-)

install.packages("foreign") ## Installed this package to import Stata ## library (foreign) ## this is for storing the package dsak <- read.dta ("C:/Users/User/Desktop/test.dta") ## here dsak is just a random name. <- is assignment and then put the name of data file and show the directory.

Hope it would help! Sincerely, Mujahed

christophergandrud commented 8 years ago

Another solution is is to use the import function from the rio package.