Reads Fixed-Width ASCII Data Files (.txt or .dat) that Have Accompanying Setup Files (.sps or .sas)
Overview
Lets you open a fixed-width ASCII file (.txt or .dat) that has an accompanying setup file (.sps or .sas). These file combinations are sometimes referred to as .txt+.sps, .txt+.sas, .dat+.sps, or .dat+.sas. This will only run in a txt-sps or txt-sas pair in which the setup file contains instructions to open that text file. It will NOT open other text files, .sav, .sas, or .por data files. Fixed-width ASCII files with setup files are common in older (pre-2000) government data.
Bug fixes
coerce_numeric = TRUEnow checks every row before converting a column to numeric. Previously files over 50,000 rows only had a random sample of rows checked (and a file of exactly 50,000 rows only 5,000), so a column with rare text values could be converted to numeric, silently turning those values intoNA, differently on every run. The sampling also changed the user's random number stream.- Values with bytes that are invalid in the current locale no longer cause an error when checking for numeric columns (the column stays character) or when applying open-ended missing value ranges.
make_sps_setup()works again on R >= 4.5.0 (it failed with "NA in coercion to boolean"), works whencol_labelsisn't given, and no longer leaves asink()open if it fails. Afile_nameending in ".SPS" no longer gets a second extension, and one merely ending in "sps" (e.g. "datasps") is no longer cut short.
Show all changes in 2.6.0Hide the rest of the changes in 2.6.0
- Missing values given as "X thru highest" no longer fail with "
labelsmust be unique" when the value X itself appears in the data. - Open-ended missing value ranges now match zero-padded data (e.g. "0000012" for "0000009 THRU HI"). Previously those values were left in the data.
- Missing value ranges written "LO THRU X" or "LOWEST THRU X" are now applied. Previously only "low thru" was recognized, so these were ignored.
make_sps_setup()'smissing_valuesaccepts column names as well as labels. Previously a column name was treated as a missing value of the column before it.- SPSS setup files whose first line is
DATA LISTcan now be read.
Speed
- Parsing setup files is much faster, especially for files with many columns (e.g. PSID setup files: from about 2 minutes to under 10 seconds).
- Reading data is faster: the data is no longer copied twice, and value labels and missing values are applied with a direct lookup.
Other changes
spss_ascii_reader()andsas_ascii_reader()now callread_ascii_setup(); results and arguments are unchanged.- Data files are read with vroom only. If vroom failed, the package used to retry silently with readr, which since readr 2.0 reads with vroom too, so the retry rarely helped and hid vroom's error. Now vroom's error is shown.
- The package no longer depends on haven or zoo.
- Requires R >= 3.6.0 (as vroom already did).
- Examples now run, and the code is commented.
- Adds a GitHub Actions R CMD check workflow, replacing Travis and AppVeyor.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 6
- Examples that run
- 100%6 run in a plain check (1 of them under a condition)
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 14
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
Commits over time
12 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/jacobkap/asciisetupreader on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Show all practicesHide 2 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-10-15Named in .gitignore: .claudePull request it wrote: opened by a project memberCommits: at least 19 crediting it in the message
- Claude Opus 5.519 commits · Oct 2026
Dependencies
Installing asciiSetupReader adds 52 packages (30 with compiled code, 47 MB of source tarballs). Heaviest: stringi 11 MB, data.table 5.7 MB, bslib 5.6 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 2.6.0Latest
- RR 4.6.0 released · 2026-04-24
- 2.5.32025-09-23 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 2.5.22024-08-17 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 2.5.12023-07-05 · diff ↗
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 2.4.02021-02-03 · diff ↗
- 2.3.22020-11-28 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 2.3.12020-03-21 · diff ↗
- 2.3.02020-01-19 · diff ↗
- 2.2.0
Show 10 earlier eventsHide 10 earlier events
Package metadata
- First published
- 2017-09-07
- Total releases
- 16 / 9 yrs
- License
- MIT + file LICENSE OSI · relicensed from GPL in 2.0.0
- Minimum R
- ≥ 3.6.0
- Download size
- 3.5 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("asciiSetupReader")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-20, which the citation names so these numbers can be found later. More on citing and the projects behind them.