File: writeForeignSPSS.R

package info (click to toggle)
foreign 0.8.67-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,564 kB
  • ctags: 863
  • sloc: ansic: 7,517; asm: 4; makefile: 1
file content (10 lines) | stat: -rw-r--r-- 297 bytes parent folder | download | duplicates (6)
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)