File: writeForeignSPSS.R

package info (click to toggle)
foreign 0.8.91-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,712 kB
  • sloc: ansic: 7,572; asm: 4; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 297 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
library(foreign)

DF <- data.frame(X1 = 1:3, X2 = 4:6, X3 = paste0("str_", 1:3), 
                 stringsAsFactors = FALSE)

write.foreign(DF, "datafile.dat", "codefile.sps", "SPSS")

files <- c( "datafile.dat", "codefile.sps")
for(f in files) tools::Rdiff(f, file.path("keep", f))
unlink(files)