Dear all,
I have a data set produced in R called (test.Rdata) and would like to import into Stata. The data set was produced in R-in Windows. My idea was to read the data first using R in my Mac (OSX: High sierra, version: 10.13.6) (R-version: R 3.5.1) and use R-foreign package to write the data file in Stata-format and then read through Stata. I have tried with the R-foreign package in my R but getting error message (please see below the R-syntax). Can anyone please possibly help with what I am doing wrong here.
Stata version: 15.2
I have a data set produced in R called (test.Rdata) and would like to import into Stata. The data set was produced in R-in Windows. My idea was to read the data first using R in my Mac (OSX: High sierra, version: 10.13.6) (R-version: R 3.5.1) and use R-foreign package to write the data file in Stata-format and then read through Stata. I have tried with the R-foreign package in my R but getting error message (please see below the R-syntax). Can anyone please possibly help with what I am doing wrong here.
Code:
setwd("/Users/kirk/Desktop/My_files/") #directory set up
> library (foreign)
> write.dta(test,"Mydata.dta")
Error in is.data.frame(dataframe) : object 'test' not found
Comment