Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

R package to read fixed-width ASCII files using SPSS or SAS setup files

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

jacobkap/asciiSetupReader

CRAN_Status_BadgeAppVeyor Build StatusCoverage statuslifecycle

Overview

Some (usually older) data sets are only available in fixed-width ASCIIfiles (.txt or .dat) that have an .sps (SPSS) or .sas (SAS) setup fileexplaining to the software how to read that file. These filecombinations are sometimes referred to as .txt+.sps, .txt+.sas,.dat+.sps, .dat+.sas. This package allows you to read in the data if youhave both the fixed-width file and its accompanying setup file.

Installation

Toinstallthispackage,usethecodeinstall.packages("asciiSetupReader")# The development version is available on Github.# install.packages("devtools")devtools::install_github("jacobkap/asciiSetupReader")

Usage

The parametersdata andsetup_file are the only ones requires to runthe package though three optional parameters allow you to customizeresults.

data - A string containing the name of the data file

setup_file - A string containing the name of the setup file

Both files must be in your working directory or the string must containthe path to the file. Below is an example of reading in the exampledataset - the original data and setup files can be foundhere.

Please note that I am only usingsystem.file() here so the vignettebuilds in the package even not on my own computer. You will not use thisin the function. Instead you’d simply inputdata = "example_data.zip"andsetup_file = "example_setup.sps". The data file does not have tobe in a zip folder, it is only in a zip folder here to reduce the sizeof this package. In most cases it will be a .dat or a .txt file.

data<- system.file("extdata","example_data.zip",package="asciiSetupReader")setup_file<- system.file("extdata","example_setup.sps",package="asciiSetupReader")example<-asciiSetupReader::read_ascii_setup(data=data,setup_file=setup_file)example[1:6,1:4]# Look at first 6 rows and first 4 columns#>   IDENTIFIER_CODE NUMERIC_STATE_CODE ORI_CODE             GROUP#> 1 SHR master file            Alabama  AL00112 Cit 50,000-99,999#> 2 SHR master file            Alabama  AL00112 Cit 50,000-99,999#> 3 SHR master file            Alabama  AL00112 Cit 50,000-99,999#> 4 SHR master file            Arizona  AZ00189       Cit < 2,500#> 5 SHR master file            Arizona  AZ00189       Cit < 2,500#> 6 SHR master file            Arizona  AZ00189       Cit < 2,500

About

R package to read fixed-width ASCII files using SPSS or SAS setup files

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp