[R] Unable to display titles in final merged SPSS output file - when merged the two SPSS data sets in R

jagadishpchary p.jagadish at inrhythm-inc.com
Thu Sep 3 09:39:09 CEST 2015


I have two large data sets in SPSS which I am trying to merge the files using
R - (for test purpose I included only two variables with 4 cases) and below
is the R syntax that I am using for merging the files.

data <- read.spss("D:/R_merge/Data.sav")
data1 <- read.spss("D:/R_merge/Data1.sav")
mydata <- smartbind(data, data1)
write.foreign(mydata, "D:/R_merge/data.txt", "D:/R_merge/data.sps",  
package="SPSS")

The issue is: when I export the data from R to SPSS the value labels
(titles) are not shown in the final merged SPSS data set - only the variable
name is shown at the title. 

I have also tried with "haven" package but the smartbind & rbind are working
properly

data <- read_sav("D:/R_merge/Data.sav")
data1 <- read_sav("D:/R_merge/Data1.sav")
mydata <- rbind(data, data1)
write_sav(data.frame(mydata), "D:/R_merge/test2.sav")

Could anyone please help me out. I am attaching 2 spss files. DATA.sav
<http://r.789695.n4.nabble.com/file/n4711786/DATA.sav>  
DATA1.sav <http://r.789695.n4.nabble.com/file/n4711786/DATA1.sav>  



--
View this message in context: http://r.789695.n4.nabble.com/Unable-to-display-titles-in-final-merged-SPSS-output-file-when-merged-the-two-SPSS-data-sets-in-R-tp4711786.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list