read_spss_data {bulkreadr} | R Documentation |
Read SPSS data file
Description
read_spss_data()
is designed to seamlessly import data from an SPSS data (.sav
or .zsav
) files. It converts labelled variables into factors, a crucial step that enhances the ease of data manipulation and analysis within the R programming environment.
Usage
read_spss_data(file, label = FALSE)
Arguments
file |
The path to the SPSS data file. |
label |
Logical indicating whether to use variable labels as column names (default is FALSE). |
Value
A tibble containing the data from the SPSS file.
See Also
read_stata_data()
which reads Stata data file and converts labelled variables into factors.
Examples
# Read an SPSS data file without converting variable labels as column names
file_path <- system.file("extdata", "Wages.sav", package = "bulkreadr")
data <- read_spss_data(file = file_path)
data
# Read an SPSS data file and convert variable labels as column names
data <- read_spss_data(file = file_path, label = TRUE)
data
[Package bulkreadr version 1.1.1 Index]