Description Usage Arguments Details Value Author(s) See Also
Writes data and SPSS syntax files.
1 2 3 4 |
dat |
A data frame which should be exported to SPSS. |
values |
A data frame with code information. See |
subunits |
A data frame with subunit information. See |
units |
A data frame with unit information. See |
filedat |
A character string with the name of the output data file. |
filesps |
A character string with the name of the output syntax file. |
missing.rule |
A list containing recode information for character missings. See |
path |
A character string containing the path of the output file.
The value in |
sep |
The separator between the data fields. |
dec |
The decimal separator for numerical data. |
verbose |
Logical. If |
This function automates most of the work needed to export a dataset to SPSS. It uses a modified version of writeForeignSPSS()
from the foreign
package and of mids2spss()
from the mice
package. The modified version allows for a choice of the field and decimal separators, makes some improvements to the formatting and provides variable labels and value labels according to the information in the data frames values
, subunits
and units
.
Examples of data frames values
, subunits
and units
can be found on data(inputList)
.
The SPSS syntax file has the proper file names and separators set, so in principle it should run and read the data without alteration. SPSS is more strict than R with respect to the paths. Always use the full path, otherwise SPSS may not be able to find the data file.
Used for its side effects. The return value is NULL
.
Nicole Haag
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.