spss_import | R Documentation |
Read a labelled data set from SPSS, finding automatically the date variables and keeping the variable and value labels information, by using the information obtained with spss_varlist()
and the function spss.get
from the Hmisc Package.
spss_import(file, allow="_",out.format="d-m-yy",use.value.labels=F,...)
file |
The path to the file with .sav extension. |
allow |
A vector which contains the characters that must be allowed in the variable names. |
out.format |
A character specifying the format for printing the date variables. |
use.value.labels |
If TRUE, replace the labelled variables with their value labels. |
... |
See |
In order to provide the maximum functionallity, if the main code generates an error, the function tries to read the file with the read_sav
function from the haven package, but a warning message appears.
The var_view
function can be used to summarize the contents of the data frame labels.
A data frame or a list containing the data stored in the SPSS file.
If the warning message appears and the file has been read using read_sav
the resulting data frame will be diferent from the expected one (see the haven package to learn more about read_sav
).
Dave MacFarlane, Roger Pros, Isaac Subirana
var_view
, spss.get
, read_sav
## Not run:
x <- spss_import("mydata.sav")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.