I am trying to use existed data in my pc which is .dta
file.
I'm trying to open it in R using the following command:
library(foreign)
mydata<-read.dta(file="C:\\Users\\me\\Desktop\\data_raw.dta")
But there is this error
>> not a Stata version 5-12 .dta file
Any help will be appreciated. Thanks.
read.dta
from the foreign package. It can only read files from Stata version 5 to 12 and your file seems to be created by a version outside that range. Maybe tryread_dta
from the haven package. – Piloting