parseScript_SPSS {EdSurvey}R Documentation

Parse SPSS Syntax Script for Fixed-Width Data Files

Description

Parses an SPSS Syntax Script (.sps) file to return information relating to fixed-width data files.

Usage

parseScript_SPSS(
  spsFilePath,
  verbose = FALSE,
  outputFormat = c("data.frame"),
  encoding = getOption("encoding")
)

Arguments

spsFilePath

a character value of the file path to the SPSS script to parse.

verbose

a logic value to indicate if user wishes to print parsing activity to console. Default value is FALSE.

outputFormat

a named argument to indicate which output format the resulting object should be. See details for information on each format. Currently, data.frame format is only supported.

encoding

a character value to indicate the encoding specification that is used by readLines base function for the spsFilePath parameter. Only adjust this parameter if the original file encoding of the file is known, is not producing correct string values, or other errors occur. See ?readLines help for details about it's use for file encoding, and additional details.

Details

NOT CURRENTLY EXPORTED! In Future this could potentially be made to a separate R package THIS parseScript_SPSS function should be used 100 Old/Previous SPSS script parsers should be slowly transitioned to utilize this function when possible to maximize code use.

The SPSS syntax script parser is focused on gathering details for use with fixed-width data files. This function scans for the following SPSS commands:

The outputFormat specified will determine the result object returned. This function currently supports the following formats.

Value

returns an object containing information specified by the outputFormat argument.

Author(s)

Tom Fink


[Package EdSurvey version 4.0.7 Index]