asciiSetupReader (version 2.3.0)

parse_setup: Parse the setup file (.sps or .sas).

Description

Parse the setup file (.sps or .sas).

Usage

parse_setup(setup_file)

Arguments

setup_file

Name of the SPSS or SAS setup file - should be a .sps or .sas (.txt also accepted as are these files in zipped format)

Value

A list of length 3. The first object ("setup") is a data frame containing 4 columns: first the non-descriptive name of each column, The second column is the descriptive name of the column. Columns three and four and the beginning and ending number of the column (used to determine the columns location in the fixed-with data file).

The second object ("value_labels") in the list is list of named vectors for the value labels. The list has a length equal to the number of columns with value labels. If there are no value labels, this will be NULL.

The third object ("missing") in the list is a data.frame with two columns. The first column says the variable name and the second column says the value that is missing and will be replaced with NA.

Examples

Run this code
# NOT RUN {
sas_name <- system.file("extdata", "example_setup.sas",
                         package = "asciiSetupReader")
sas_example <- parse_setup(sas_name)

sps_name <- system.file("extdata", "example_setup.sps",
                         package = "asciiSetupReader")
sps_example <- parse_setup(sps_name)
# }

Run the code above in your browser using DataCamp Workspace