Skip to contents

A .spv file is SPSS's rendered OUTPUT, but its structure XML embeds the exact syntax that produced each result (see .spv_read_structure(), .spv_read()'s syntax field) — the same commands a researcher would normally save separately as a .sps syntax file, but here recovered from the output alone. Since .spv is classed data_type = "output" (see .data_check_types() / .data_check_type() in R/data_check_helpers.R), this materialises that recovered syntax as real CODE, in a code subdirectory alongside the original .spv file, so it is discoverable the same way an author's own saved .sps file would be — and, crucially, so it then flows through code_check()'s ordinary SPSS-language analysis (comments, absolute paths, library lines, ...) unmodified, since code_lang() already recognises .sps (see .code_expand_spv() in R/code_check.R, this function's only caller).

Usage

.spv_export_syntax(spv_path, code_dir_name = "code")

Arguments

spv_path

path to the .spv file.

code_dir_name

name of the sibling code subdirectory to write into, relative to spv_path's own directory. Default "code". A file of the user's own gets this folder in the temporary folder instead, so the user's folder is not changed (see .recovered_code_dir()).

Value

the path to the written .sps file, or NA_character_ if the archive has no recoverable syntax (e.g. every command was skipped by this port's "core tables only" scope, or the file has no structure XML at all).