[R] exporting data to stata

rosario scandurra sasha_1891 at hotmail.com
Thu Mar 22 08:46:54 CET 2018


I am new to R and I want to export data into Stata. Could somebody help with that? Thanks a lot.

This is the code I am using:

> setwd("D:/datasets/Seg-bcn/ESBD")
> data1 <- readRDS("r17045_ESDB_Habitatges_BDD_V_1_0.rds")
> library(foreign)
> write.dta(data="data1", file = "D:/datasets/data1.dta")
Error in write.dta(data = "data1", file = "D:/datasets/data1.dta") :
  The object "dataframe" must have class data.frame
> class (data1)
[1] "survey.design2" "survey.design"

	[[alternative HTML version deleted]]

More information about the R-help mailing list