syntaxr is a package I wrote to assist in a research project I was working on. Our team was using SPSS for analyzing a dataset exported weekly from REDCap, but the files provided needed to be restructured and cleaned up every week. Since all lab members already had knowledge of SPSS, we opted to carry out all data cleaning with an SPSS syntax file. Our database had several hundreds of variables, which required writing hundreds of lines of syntax in SPSS : I wrote
syntaxr to generate the syntax code through vectorized processes, with only a few lines of code in R. This provided us with a complete
.sps syntax file, and streamlined the coding task so we could invest our time in the other steps of the data analysis process.
How to use the package
The package provides overall enhanced flexibility for variable manipulation, and facilitates the streamlining of SPSS dataset transformation. This package was designed for systematic transformation of variables, and is especially suited for large datasets that don’t lend themselves to easy bulk manipulation. It can also be used to selectively apply SPSS functions to variables, according to simple or complex criteria.
Recommended installation is through CRAN :
install.packages('syntaxr'). Alternatively, the latest development version can be installed with devtools :
devtools::install_github("greenmeen/syntaxr"). Further documentation about how to use the package is available in the project’s GitHub repository.