Skip to content

Commit

Permalink
resolving one decade of CRAN check problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ajdamico committed Apr 27, 2022
1 parent 3d45a8b commit 7e69cd2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: SAScii
Type: Package
Title: Import ASCII files directly into R using only a SAS input script
Version: 1.0
Date: 2012-08-18
Title: Import ASCII Files Directly into R using Only a 'SAS' Input Script
Version: 1.0.1
Date: 2022-04-27
Authors@R: person( "Anthony Joseph" , "Damico" , role = c( "aut" , "cre" ) , email = "ajdamico@gmail.com" )
Description: Using any importation code designed for SAS users to read ASCII files into sas7bdat files, the SAScii package parses through the INPUT block of a (.sas) syntax file to design the parameters needed for a read.fwf function call. This allows the user to specify the location of the ASCII (often a .dat) file and the location of the .sas syntax file, and then load the data frame directly into R in just one step.
Description: Using any importation code designed for 'SAS' users to read ASCII files into 'sas7bdat' files, this package parses through the INPUT block of a '.sas' syntax file to design the parameters needed for a 'read.fwf()' function call. This allows the user to specify the location of the ASCII (often a '.dat') file and the location of the 'SAS' syntax file, and then load the data frame directly into R in just one step.
License: GPL (>= 2)
URL: https://github.com/ajdamico/SAScii
Depends: R (>= 2.14)
Depends: R (>= 4.2.0)
LazyLoad: Yes
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
importFrom("utils", "capture.output", "download.file", "read.fwf", "unzip")
export(parse.SAScii)
export(read.SAScii)
8 changes: 2 additions & 6 deletions R/parse.SAScii.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,8 @@ function( sas_ri , beginline = 1 , lrecl = NULL ){
}

#the width should be the end position minus the beginning position, plus one
x <-
transform(
x ,
width = as.numeric(end) - as.numeric(start) + 1
)

x[ , 'width' ] <- as.numeric( x[ , 'end' ] ) - as.numeric( x[ , 'start' ] ) + 1

#if there's no variable name, it should be a negative.
x[ is.na( x[ , 'varname' ] ) , 'width' ] <- ( -1 * x[ is.na( x[ , 'varname' ] ) , 'width' ] )

Expand Down
18 changes: 16 additions & 2 deletions man/read.SAScii.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ Create an R data frame by reading in an ASCII file and SAS import instructions
Using importation code designed for SAS users to read ASCII files into sas7bdat files, the read.SAScii function parses through the INPUT block of a (.sas) syntax file to design the parameters needed for a read.fwf function call, and then runs that command. This allows the user to specify the location of the ASCII (often a .dat) file and the location of the .sas syntax file, and then load the data frame directly into R in just one step.
}
\usage{
read.SAScii( fn, sas_ri, beginline = 1, buffersize = 50, zipped = F , n = -1 , intervals.to.print = 1000 , lrecl = NULL , skip.decimal.division = NULL )
read.SAScii( fn,
sas_ri,
beginline = 1,
buffersize = 50,
zipped = F ,
n = -1 ,
intervals.to.print = 1000 ,
lrecl = NULL ,
skip.decimal.division = NULL
)
}
\arguments{
\item{fn}{
Expand Down Expand Up @@ -371,7 +380,12 @@ SIPP.04w1.sas <- parse.SAScii( SIPP.04w1.SAS.read.in.instructions , beginline =
for ( i in 1:12 ){

SIPP.04wX.file.location <-
paste( "http://smpbff2.dsd.census.gov/pub/sipp/2004/l04puw" , i , ".zip" , sep = "" )
paste(
"http://smpbff2.dsd.census.gov/pub/sipp/2004/l04puw" ,
i ,
".zip" ,
sep = ""
)

#name the data frame based on the current wave
df.name <- paste( "SIPP.04w" , i , ".df" , sep = "" )
Expand Down

0 comments on commit 7e69cd2

Please sign in to comment.