Thread: [R-gregmisc-users] SF.net SVN: r-gregmisc: [1107] trunk/SASxport/tests
Brought to you by:
warnes
From: <wa...@us...> - 2007-07-29 01:15:24
|
Revision: 1107 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1107&view=rev Author: warnes Date: 2007-07-28 18:15:04 -0700 (Sat, 28 Jul 2007) Log Message: ----------- Add SAS code to create xport data files for testing Added Paths: ----------- trunk/SASxport/tests/cars.sas trunk/SASxport/tests/cars.xpt trunk/SASxport/tests/xxx.sas trunk/SASxport/tests/xxx.xpt Removed Paths: ------------- trunk/SASxport/tests/Alfalfa2.xpt Deleted: trunk/SASxport/tests/Alfalfa2.xpt =================================================================== (Binary files differ) Added: trunk/SASxport/tests/cars.sas =================================================================== --- trunk/SASxport/tests/cars.sas (rev 0) +++ trunk/SASxport/tests/cars.sas 2007-07-29 01:15:04 UTC (rev 1107) @@ -0,0 +1,44 @@ +DATA cars1; + input MAKE $ PRICE MPG REP78 FOREIGN; +DATALINES; +AMC 4099 22 3 0 +AMC 4749 17 3 0 +AMC 3799 22 3 0 +Audi 9690 17 5 1 +Audi 6295 23 3 1 +BMW 9735 25 4 1 +Buick 4816 20 3 0 +Buick 7827 15 4 0 +Buick 5788 18 3 0 +Buick 4453 26 3 0 +Buick 5189 20 3 0 +Buick 10372 16 3 0 +Buick 4082 19 3 0 +Cad. 11385 14 3 0 +Cad. 14500 14 2 0 +Cad. 15906 21 3 0 +Chev. 3299 29 3 0 +Chev. 5705 16 4 0 +Chev. 4504 22 3 0 +Chev. 5104 22 2 0 +Chev. 3667 24 2 0 +Chev. 3955 19 3 0 +Datsun 6229 23 4 1 +Datsun 4589 35 5 1 +Datsun 5079 24 4 1 +Datsun 8129 21 4 1 +; +RUN; + +PROC PRINT DATA=cars1(obs=5); +RUN; + +PROC MEANS DATA=cars1; +RUN; + +LIBNAME out XPORT './cars.xpt'; + +DATA out.cars; + SET cars1; +RUN; + Added: trunk/SASxport/tests/cars.xpt =================================================================== (Binary files differ) Property changes on: trunk/SASxport/tests/cars.xpt ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/SASxport/tests/xxx.sas =================================================================== --- trunk/SASxport/tests/xxx.sas (rev 0) +++ trunk/SASxport/tests/xxx.sas 2007-07-29 01:15:04 UTC (rev 1107) @@ -0,0 +1,12 @@ +libname xxx xport 'xxx.xpt'; +data temp; input x y $ @@; cards; +1 a 2 B . . .a * +run; +data temp; set temp; +format x date7.; label y='character variable'; run; +proc print data=temp; format x y ; run; +proc print data=temp; run; +proc contents; run; +data xxx.abc; set; run; +options ls=132; +data _null_; infile 'xxx.xpt' recfm=f lrecl=80; input x $char80.;list;run; Added: trunk/SASxport/tests/xxx.xpt =================================================================== (Binary files differ) Property changes on: trunk/SASxport/tests/xxx.xpt ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2007-08-03 00:35:19
|
Revision: 1109 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1109&view=rev Author: warnes Date: 2007-08-02 17:35:07 -0700 (Thu, 02 Aug 2007) Log Message: ----------- Add more tests Added Paths: ----------- trunk/SASxport/tests/cars.R trunk/SASxport/tests/datetime.xpt trunk/SASxport/tests/testDates.R trunk/SASxport/tests/xxx.R Added: trunk/SASxport/tests/cars.R =================================================================== --- trunk/SASxport/tests/cars.R (rev 0) +++ trunk/SASxport/tests/cars.R 2007-08-03 00:35:07 UTC (rev 1109) @@ -0,0 +1,25 @@ +library(SASxport) + + +cars <- read.table(file="cars.sas", skip=3, nrows=26, + col.names=c("MAKE","PRICE","MPG","REP78","FOREIGN"), + header=F) + +head(cars, n=5) + +summary(cars) + +write.xport(cars, + filename="cars2.xpt", + cDate=strptime("28JUL07: 20:59:49", format="%d%b%y:%H:%M:%S"), + osType="SunOS", + sasVer="9.1" +) + + +## Load both files back in as raw data +a.1 <- readBin( con="cars.xpt", what=raw(), n=1e5) +a.2 <- readBin( con="cars2.xpt", what=raw(), n=1e5) + +## Test that the files are identical +assert( all(a.1 == a.2) ) Added: trunk/SASxport/tests/datetime.xpt =================================================================== (Binary files differ) Property changes on: trunk/SASxport/tests/datetime.xpt ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/SASxport/tests/testDates.R =================================================================== --- trunk/SASxport/tests/testDates.R (rev 0) +++ trunk/SASxport/tests/testDates.R 2007-08-03 00:35:07 UTC (rev 1109) @@ -0,0 +1,23 @@ +library(SASxport) + +## Create a small data set containing dates, times, and date-times + +dates <- c("02/27/92", "02/27/92", "01/14/92", "02/28/92", "02/01/92") +times <- c("23:03:20", "22:29:56", "01:03:30", "18:21:03", "16:56:26") + + +temp <- data.frame(x=c(1, 2, 3, 4, 5 ), + y=c('a', 'B', 'c', 'd', 'e' ), + dates=strptime(dates, "%m/%d/%y"), + datetimes=strptime( paste(dates,times), "%m/%d/%y %H:%M:%S") +) + +print(temp) + +write.xport( DATETIME=temp, filename="datetime.xpt") +temp2 <- read.xport(file="datetime.xpt") + +print(temp2) + + +identical(temp, temp2) Added: trunk/SASxport/tests/xxx.R =================================================================== --- trunk/SASxport/tests/xxx.R (rev 0) +++ trunk/SASxport/tests/xxx.R 2007-08-03 00:35:07 UTC (rev 1109) @@ -0,0 +1,54 @@ +library(SASxport) + +## manually create a data set +abc <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) + +## add a format specifier (not used by R) +attr(abc$x, 'format') <- 'date7.' + +## add a variable label (not used by R) +attr(abc$y, 'label') <- 'character variable' + +# create a SAS XPORT file from our local data fram +write.xport(abc, + filename="xxx2.xpt", + cDate=strptime("28JUL07:21:08:06 ", format="%d%b%y:%H:%M:%S"), + osType="SunOS", + sasVer="9.1" + ) + +# read the original SAS data file +abc.SAS <- read.xport("xxx.xpt") + +## read.xport currently doesn't store the format and label attributes... +attr(abc.SAS$X, 'format') <- 'date7.' +attr(abc.SAS$Y, 'label') <- 'character variable' + +# create a SAS XPORT file from the SAS data +write.xport(abc=abc.SAS, + filename="xxx3.xpt", + cDate=strptime("28JUL07:21:08:06 ", format="%d%b%y:%H:%M:%S"), + osType="SunOS", + sasVer="9.1" + ) + + + + +## Load both files back in as raw data +a.1 <- readBin( con="xxx.xpt", what=raw(), n=1e5 ) +a.2 <- readBin( con="xxx2.xpt", what=raw(), n=1e5 ) +a.3 <- readBin( con="xxx3.xpt", what=raw(), n=1e5 ) + +## R doesn't have multiple NA types, while SAS does. The original +## file contains a SAS '.A' missing value, while what we've created +## contains an ordinary '.' missing value, so mash this one byte to +## avoid a comparison error for this know limitation. + +a.1[1089] <- as.raw("0x2e") + +## Test that the files are otherwise identical +assert( all(a.1 == a.2) ) +assert( all(a.1 == a.3) ) + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2007-08-08 18:54:27
|
Revision: 1125 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1125&view=rev Author: warnes Date: 2007-08-08 11:54:23 -0700 (Wed, 08 Aug 2007) Log Message: ----------- Updates Modified Paths: -------------- trunk/SASxport/tests/Alfalfa_Test.R trunk/SASxport/tests/Alfalfa_Test.Rout.save trunk/SASxport/tests/cars.R trunk/SASxport/tests/cars.Rout.save trunk/SASxport/tests/datetime.xpt trunk/SASxport/tests/testDates.R trunk/SASxport/tests/test_fields.R trunk/SASxport/tests/test_fields.Rout.save trunk/SASxport/tests/xport.R trunk/SASxport/tests/xxx.R trunk/SASxport/tests/xxx.Rout.save Modified: trunk/SASxport/tests/Alfalfa_Test.R =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.R 2007-08-08 18:54:00 UTC (rev 1124) +++ trunk/SASxport/tests/Alfalfa_Test.R 2007-08-08 18:54:23 UTC (rev 1125) @@ -19,4 +19,4 @@ a.2 <- readBin( con="Alfalfa2.xpt", what=raw(), n=3600 ) ## Test that the files are identical -assert( all(a.1 == a.2) ) +SASxport:::assert( all(a.1 == a.2) ) Modified: trunk/SASxport/tests/Alfalfa_Test.Rout.save =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-08-08 18:54:00 UTC (rev 1124) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-08-08 18:54:23 UTC (rev 1125) @@ -43,7 +43,7 @@ > a.2 <- readBin( con="Alfalfa2.xpt", what=raw(), n=3600 ) > > ## Test that the files are identical -> assert( all(a.1 == a.2) ) +> SASxport:::assert( all(a.1 == a.2) ) > > proc.time() [1] 0.939 0.103 1.212 0.000 0.000 Modified: trunk/SASxport/tests/cars.R =================================================================== --- trunk/SASxport/tests/cars.R 2007-08-08 18:54:00 UTC (rev 1124) +++ trunk/SASxport/tests/cars.R 2007-08-08 18:54:23 UTC (rev 1125) @@ -22,4 +22,4 @@ a.2 <- readBin( con="cars2.xpt", what=raw(), n=1e5) ## Test that the files are identical -assert( all(a.1 == a.2) ) +SASxport:::assert( all(a.1 == a.2) ) Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2007-08-08 18:54:00 UTC (rev 1124) +++ trunk/SASxport/tests/cars.Rout.save 2007-08-08 18:54:23 UTC (rev 1125) @@ -62,7 +62,7 @@ > a.2 <- readBin( con="cars2.xpt", what=raw(), n=1e5) > > ## Test that the files are identical -> assert( all(a.1 == a.2) ) +> SASxport:::assert( all(a.1 == a.2) ) > > proc.time() [1] 0.920 0.097 1.079 0.000 0.000 Modified: trunk/SASxport/tests/datetime.xpt =================================================================== (Binary files differ) Modified: trunk/SASxport/tests/testDates.R =================================================================== --- trunk/SASxport/tests/testDates.R 2007-08-08 18:54:00 UTC (rev 1124) +++ trunk/SASxport/tests/testDates.R 2007-08-08 18:54:23 UTC (rev 1125) @@ -15,7 +15,7 @@ print(temp) write.xport( DATETIME=temp, filename="datetime.xpt") -temp2 <- read.xport(file="datetime.xpt") +temp2 <- read.xport(file="datetime.xpt", names.tolower=FALSE) print(temp2) Modified: trunk/SASxport/tests/test_fields.R =================================================================== --- trunk/SASxport/tests/test_fields.R 2007-08-08 18:54:00 UTC (rev 1124) +++ trunk/SASxport/tests/test_fields.R 2007-08-08 18:54:23 UTC (rev 1125) @@ -4,4 +4,4 @@ .C("doTest",PACKAGE="SASxport") -## Successful completion means all assertions have been met +## Successful completion means all SASxport:::assertions have been met Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2007-08-08 18:54:00 UTC (rev 1124) +++ trunk/SASxport/tests/test_fields.Rout.save 2007-08-08 18:54:23 UTC (rev 1125) @@ -31,7 +31,7 @@ > .C("doTest",PACKAGE="SASxport") list() > -> ## Successful completion means all assertions have been met +> ## Successful completion means all SASxport:::assertions have been met > > proc.time() [1] 0.843 0.093 0.925 0.000 0.000 Modified: trunk/SASxport/tests/xport.R =================================================================== --- trunk/SASxport/tests/xport.R 2007-08-08 18:54:00 UTC (rev 1124) +++ trunk/SASxport/tests/xport.R 2007-08-08 18:54:23 UTC (rev 1125) @@ -1,9 +1,15 @@ library(SASxport) + lookup.xport("Alfalfa.xpt") + Alfalfa <- read.xport("Alfalfa.xpt") + summary(Alfalfa) + ## test data provided by FR...@bi... + lookup.xport("test.xpt") testdata <- read.xport("test.xpt") summary(testdata) + q() Modified: trunk/SASxport/tests/xxx.R =================================================================== --- trunk/SASxport/tests/xxx.R 2007-08-08 18:54:00 UTC (rev 1124) +++ trunk/SASxport/tests/xxx.R 2007-08-08 18:54:23 UTC (rev 1125) @@ -18,11 +18,10 @@ ) # read the original SAS data file -abc.SAS <- read.xport("xxx.xpt") +abc.SAS <- read.xport("xxx.xpt", names.tolower=FALSE) -## read.xport currently doesn't store the format and label attributes... +## read.xport currently doesn't store the format attribute... attr(abc.SAS$X, 'format') <- 'date7.' -attr(abc.SAS$Y, 'label') <- 'character variable' # create a SAS XPORT file from the SAS data write.xport(abc=abc.SAS, @@ -48,7 +47,7 @@ a.1[1089] <- as.raw("0x2e") ## Test that the files are otherwise identical -assert( all(a.1 == a.2) ) -assert( all(a.1 == a.3) ) +SASxport:::assert( all(a.1 == a.2) ) +SASxport:::assert( all(a.1 == a.3) ) Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2007-08-08 18:54:00 UTC (rev 1124) +++ trunk/SASxport/tests/xxx.Rout.save 2007-08-08 18:54:23 UTC (rev 1125) @@ -74,8 +74,8 @@ > a.1[1089] <- as.raw("0x2e") > > ## Test that the files are otherwise identical -> assert( all(a.1 == a.2) ) -> assert( all(a.1 == a.3) ) +> SASxport:::assert( all(a.1 == a.2) ) +> SASxport:::assert( all(a.1 == a.3) ) > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2007-08-09 16:53:15
|
Revision: 1127 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1127&view=rev Author: warnes Date: 2007-08-09 09:53:14 -0700 (Thu, 09 Aug 2007) Log Message: ----------- Update saved output of test scripts Modified Paths: -------------- trunk/SASxport/tests/testDates.Rout.save trunk/SASxport/tests/test_fields.Rout.save trunk/SASxport/tests/xport.Rout.save trunk/SASxport/tests/xxx.Rout.save Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2007-08-08 18:54:43 UTC (rev 1126) +++ trunk/SASxport/tests/testDates.Rout.save 2007-08-09 16:53:14 UTC (rev 1127) @@ -1,6 +1,6 @@ -R version 2.4.1 (2006-12-18) -Copyright (C) 2006 The R Foundation for Statistical Computing +R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -15,16 +15,16 @@ 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. -******************************************************* -** This copy of RPro is licensed to: ** -** Gregory R. Warnes ** -******************************************************* +> library(SASxport) +Attaching package: 'SASxport' -[Previously saved workspace restored] -> invisible(options(echo = TRUE)) -> library(SASxport) + The following object(s) are masked from package:base : + + units, + units<- + > > ## Create a small data set containing dates, times, and date-times > @@ -47,7 +47,7 @@ 5 5 e 1992-02-01 1992-02-01 16:56:26 > > write.xport( DATETIME=temp, filename="datetime.xpt") -> temp2 <- read.xport(file="datetime.xpt") +> temp2 <- read.xport(file="datetime.xpt", names.tolower=FALSE) > > print(temp2) X Y DATES DATETIME @@ -61,6 +61,3 @@ > identical(temp, temp2) [1] FALSE > -> proc.time() -[1] 0.889 0.099 0.999 0.000 0.000 -> Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2007-08-08 18:54:43 UTC (rev 1126) +++ trunk/SASxport/tests/test_fields.Rout.save 2007-08-09 16:53:14 UTC (rev 1127) @@ -1,6 +1,6 @@ -R version 2.4.1 (2006-12-18) -Copyright (C) 2006 The R Foundation for Statistical Computing +R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -15,16 +15,16 @@ 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. -******************************************************* -** This copy of RPro is licensed to: ** -** Gregory R. Warnes ** -******************************************************* +> library(SASxport) +Attaching package: 'SASxport' -[Previously saved workspace restored] -> invisible(options(echo = TRUE)) -> library(SASxport) + The following object(s) are masked from package:base : + + units, + units<- + > > ## Call C-level test routines > @@ -33,6 +33,3 @@ > > ## Successful completion means all SASxport:::assertions have been met > -> proc.time() -[1] 0.843 0.093 0.925 0.000 0.000 -> Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2007-08-08 18:54:43 UTC (rev 1126) +++ trunk/SASxport/tests/xport.Rout.save 2007-08-09 16:53:14 UTC (rev 1127) @@ -1,6 +1,6 @@ -R version 2.4.1 (2006-12-18) -Copyright (C) 2006 The R Foundation for Statistical Computing +R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -15,16 +15,17 @@ 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. -******************************************************* -** This copy of RPro is licensed to: ** -** Gregory R. Warnes ** -******************************************************* +> library(SASxport) +Attaching package: 'SASxport' -[Previously saved workspace restored] -> invisible(options(echo = TRUE)) -> library(SASxport) + The following object(s) are masked from package:base : + + units, + units<- + +> > lookup.xport("Alfalfa.xpt") $SPEC $SPEC$headpad @@ -61,23 +62,27 @@ [1] 40 +> > Alfalfa <- read.xport("Alfalfa.xpt") +> > summary(Alfalfa) - POP SAMPLE REP SEEDWT HARV1 + pop sample rep seedwt harv1 MAX:20 Min. :0.0 Min. :1.00 Min. :35.00 Min. :120.6 min:20 1st Qu.:2.0 1st Qu.:1.75 1st Qu.:47.75 1st Qu.:148.3 Median :4.5 Median :2.50 Median :59.00 Median :165.8 Mean :4.5 Mean :2.50 Mean :56.08 Mean :163.0 3rd Qu.:7.0 3rd Qu.:3.25 3rd Qu.:62.25 3rd Qu.:176.4 Max. :9.0 Max. :4.00 Max. :75.00 Max. :193.4 - HARV2 + harv2 Min. :129.1 1st Qu.:150.6 Median :163.2 Mean :167.1 3rd Qu.:179.6 Max. :235.3 +> > ## test data provided by FR...@bi... +> > lookup.xport("test.xpt") $TEST $TEST$headpad @@ -116,11 +121,12 @@ > testdata <- read.xport("test.xpt") > summary(testdata) - I K + i k Min. :1.00 Min. :1 1st Qu.:1.75 1st Qu.:1 Median :2.50 Median :2 Mean :2.50 Mean :2 3rd Qu.:3.25 3rd Qu.:3 Max. :4.00 Max. :3 +> > q() Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2007-08-08 18:54:43 UTC (rev 1126) +++ trunk/SASxport/tests/xxx.Rout.save 2007-08-09 16:53:14 UTC (rev 1127) @@ -1,6 +1,6 @@ -R version 2.4.1 (2006-12-18) -Copyright (C) 2006 The R Foundation for Statistical Computing +R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -15,16 +15,16 @@ 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. -******************************************************* -** This copy of RPro is licensed to: ** -** Gregory R. Warnes ** -******************************************************* +> library(SASxport) +Attaching package: 'SASxport' -[Previously saved workspace restored] -> invisible(options(echo = TRUE)) -> library(SASxport) + The following object(s) are masked from package:base : + + units, + units<- + > > ## manually create a data set > abc <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) @@ -44,11 +44,10 @@ + ) > > # read the original SAS data file -> abc.SAS <- read.xport("xxx.xpt") +> abc.SAS <- read.xport("xxx.xpt", names.tolower=FALSE) > -> ## read.xport currently doesn't store the format and label attributes... +> ## read.xport currently doesn't store the format attribute... > attr(abc.SAS$X, 'format') <- 'date7.' -> attr(abc.SAS$Y, 'label') <- 'character variable' > > # create a SAS XPORT file from the SAS data > write.xport(abc=abc.SAS, @@ -79,6 +78,3 @@ > > > -> proc.time() -[1] 0.873 0.096 1.027 0.000 0.000 -> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2007-08-09 23:29:40
|
Revision: 1132 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1132&view=rev Author: warnes Date: 2007-08-09 16:28:42 -0700 (Thu, 09 Aug 2007) Log Message: ----------- More changes, esp to lookup.xport() and friends Modified Paths: -------------- trunk/SASxport/tests/Alfalfa_Test.Rout.save trunk/SASxport/tests/cars.Rout.save trunk/SASxport/tests/xport.Rout.save Modified: trunk/SASxport/tests/Alfalfa_Test.Rout.save =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-08-09 23:28:27 UTC (rev 1131) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-08-09 23:28:42 UTC (rev 1132) @@ -1,6 +1,6 @@ -R version 2.4.1 (2006-12-18) -Copyright (C) 2006 The R Foundation for Statistical Computing +R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -15,17 +15,19 @@ 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. -******************************************************* -** This copy of RPro is licensed to: ** -** Gregory R. Warnes ** -******************************************************* - - -> invisible(options(echo = TRUE)) > ## This test demonstrates that write.xport can exactly duplicate an > ## existing SAS xport file "Alfalfa.xpt" > > library(SASxport) + +Attaching package: 'SASxport' + + + The following object(s) are masked from package:base : + + units, + units<- + > > # existing data file > SPEC <- read.xport("Alfalfa.xpt") @@ -45,6 +47,3 @@ > ## Test that the files are identical > SASxport:::assert( all(a.1 == a.2) ) > -> proc.time() -[1] 0.939 0.103 1.212 0.000 0.000 -> Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2007-08-09 23:28:27 UTC (rev 1131) +++ trunk/SASxport/tests/cars.Rout.save 2007-08-09 23:28:42 UTC (rev 1132) @@ -1,6 +1,6 @@ -R version 2.4.1 (2006-12-18) -Copyright (C) 2006 The R Foundation for Statistical Computing +R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -15,16 +15,16 @@ 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. -******************************************************* -** This copy of RPro is licensed to: ** -** Gregory R. Warnes ** -******************************************************* +> library(SASxport) +Attaching package: 'SASxport' -[Previously saved workspace restored] -> invisible(options(echo = TRUE)) -> library(SASxport) + The following object(s) are masked from package:base : + + units, + units<- + > > > cars <- read.table(file="cars.sas", skip=3, nrows=26, @@ -64,6 +64,3 @@ > ## Test that the files are identical > SASxport:::assert( all(a.1 == a.2) ) > -> proc.time() -[1] 0.920 0.097 1.079 0.000 0.000 -> Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2007-08-09 23:28:27 UTC (rev 1131) +++ trunk/SASxport/tests/xport.Rout.save 2007-08-09 23:28:42 UTC (rev 1132) @@ -27,41 +27,20 @@ > > lookup.xport("Alfalfa.xpt") -$SPEC -$SPEC$headpad -[1] 1360 -$SPEC$type -[1] "character" "numeric" "numeric" "numeric" "numeric" "numeric" +SAS xport file +-------------- +Filename: `Alfalfa.xpt' -$SPEC$width -[1] 8 8 8 8 8 8 +Variables in data set `SPEC': + dataset name type format width label nobs +SPEC.POP SPEC POP character 8 40 +SPEC.SAMPLE SPEC SAMPLE numeric 8 40 +SPEC.REP SPEC REP numeric 8 40 +SPEC.SEEDWT SPEC SEEDWT numeric 8 40 +SPEC.HARV1 SPEC HARV1 numeric 8 40 +SPEC.HARV2 SPEC HARV2 numeric 8 40 -$SPEC$index -[1] 1 2 3 4 5 6 - -$SPEC$position -[1] 0 8 16 24 32 40 - -$SPEC$name -[1] "POP" "SAMPLE" "REP" "SEEDWT" "HARV1" "HARV2" - -$SPEC$label -[1] "" "" "" "" "" "" - -$SPEC$format -[1] "" "" "" "" "" "" - -$SPEC$sexptype -[1] 16 14 14 14 14 14 - -$SPEC$tailpad -[1] 0 - -$SPEC$length -[1] 40 - - > > Alfalfa <- read.xport("Alfalfa.xpt") > @@ -84,41 +63,16 @@ > ## test data provided by FR...@bi... > > lookup.xport("test.xpt") -$TEST -$TEST$headpad -[1] 800 -$TEST$type -[1] "numeric" "numeric" +SAS xport file +-------------- +Filename: `test.xpt' -$TEST$width -[1] 8 8 +Variables in data set `TEST': + dataset name type format width label nobs +TEST.I TEST I numeric 8 12 +TEST.K TEST K numeric 8 12 -$TEST$index -[1] 1 2 - -$TEST$position -[1] 0 8 - -$TEST$name -[1] "I" "K" - -$TEST$label -[1] "" "" - -$TEST$format -[1] "" "" - -$TEST$sexptype -[1] 14 14 - -$TEST$tailpad -[1] 48 - -$TEST$length -[1] 12 - - > testdata <- read.xport("test.xpt") > summary(testdata) i k This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2007-09-07 16:32:38
|
Revision: 1166 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1166&view=rev Author: warnes Date: 2007-09-07 09:32:31 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Change argument name in write.xport from 'filename' to 'file' to match read.xport Modified Paths: -------------- trunk/SASxport/tests/Alfalfa_Test.Rout.save trunk/SASxport/tests/cars.Rout.save trunk/SASxport/tests/testDates.Rout.save trunk/SASxport/tests/xxx.Rout.save Modified: trunk/SASxport/tests/Alfalfa_Test.Rout.save =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-09-07 16:25:56 UTC (rev 1165) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-09-07 16:32:31 UTC (rev 1166) @@ -1,5 +1,5 @@ -R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +R version 2.5.1 (2007-06-27) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -34,7 +34,7 @@ > > ## Write it out again, pretending to be the same OS, SAS version, and creation date > write.xport(SPEC, -+ filename="Alfalfa2.xpt", ++ file="Alfalfa2.xpt", + cDate=strptime("10DEC99:15:56:30", format="%d%b%y:%H:%M:%S"), + osType="OSF1", + sasVer="7.00" Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2007-09-07 16:25:56 UTC (rev 1165) +++ trunk/SASxport/tests/cars.Rout.save 2007-09-07 16:32:31 UTC (rev 1166) @@ -1,5 +1,5 @@ -R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +R version 2.5.1 (2007-06-27) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -50,7 +50,7 @@ Datsun:4 > > write.xport(cars, -+ filename="cars2.xpt", ++ file="cars2.xpt", + cDate=strptime("28JUL07: 20:59:49", format="%d%b%y:%H:%M:%S"), + osType="SunOS", + sasVer="9.1" Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2007-09-07 16:25:56 UTC (rev 1165) +++ trunk/SASxport/tests/testDates.Rout.save 2007-09-07 16:32:31 UTC (rev 1166) @@ -1,5 +1,5 @@ -R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +R version 2.5.1 (2007-06-27) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -46,7 +46,7 @@ 4 4 d 1992-02-28 1992-02-28 18:21:03 5 5 e 1992-02-01 1992-02-01 16:56:26 > -> write.xport( DATETIME=temp, filename="datetime.xpt") +> write.xport( DATETIME=temp, file="datetime.xpt") > temp2 <- read.xport(file="datetime.xpt", names.tolower=FALSE) > > print(temp2) Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2007-09-07 16:25:56 UTC (rev 1165) +++ trunk/SASxport/tests/xxx.Rout.save 2007-09-07 16:32:31 UTC (rev 1166) @@ -1,5 +1,5 @@ -R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +R version 2.5.1 (2007-06-27) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -37,7 +37,7 @@ > > # create a SAS XPORT file from our local data fram > write.xport(abc, -+ filename="xxx2.xpt", ++ file="xxx2.xpt", + cDate=strptime("28JUL07:21:08:06 ", format="%d%b%y:%H:%M:%S"), + osType="SunOS", + sasVer="9.1" @@ -51,7 +51,7 @@ > > # create a SAS XPORT file from the SAS data > write.xport(abc=abc.SAS, -+ filename="xxx3.xpt", ++ file="xxx3.xpt", + cDate=strptime("28JUL07:21:08:06 ", format="%d%b%y:%H:%M:%S"), + osType="SunOS", + sasVer="9.1" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2007-09-07 16:48:22
|
Revision: 1167 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1167&view=rev Author: warnes Date: 2007-09-07 09:47:08 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Add round-trip test for Theoph data set Added Paths: ----------- trunk/SASxport/tests/Theoph.R trunk/SASxport/tests/Theoph.Rout.save Added: trunk/SASxport/tests/Theoph.R =================================================================== --- trunk/SASxport/tests/Theoph.R (rev 0) +++ trunk/SASxport/tests/Theoph.R 2007-09-07 16:47:08 UTC (rev 1167) @@ -0,0 +1,19 @@ + +#### +## Round-trip test on Theoph data +#### + +library(SASxport) + +write.xport(Theoph,file="theoph.xpt") +Theoph.2 <- read.xport("theoph.xpt") + +## Revert to mixed case names +names(Theoph.2) <- names(Theoph) + +## Test equality, handling the ordered factor Subject separately because +## SAS xport files don't provide a mechanism for storing factor orders + +SASxport:::assert( all( as.character(Theoph$Subject) == as.character(Theoph.2$Subject) )) +SASxport:::assert( all(Theoph[,-1] == Theoph.2[,-1]) ) + Added: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save (rev 0) +++ trunk/SASxport/tests/Theoph.Rout.save 2007-09-07 16:47:08 UTC (rev 1167) @@ -0,0 +1,46 @@ + +R version 2.5.1 (2007-06-27) +Copyright (C) 2007 The R Foundation for Statistical Computing +ISBN 3-900051-07-0 + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> +> #### +> ## Round-trip test on Theoph data +> #### +> +> library(SASxport) + +Attaching package: 'SASxport' + + + The following object(s) are masked from package:base : + + units, + units<- + +> +> write.xport(Theoph,file="theoph.xpt") +> Theoph.2 <- read.xport("theoph.xpt") +> +> ## Revert to mixed case names +> names(Theoph.2) <- names(Theoph) +> +> ## Test equality, handling the ordered factor Subject separately because +> ## SAS xport files don't provide a mechanism for storing factor orders +> +> SASxport:::assert( all( as.character(Theoph$Subject) == as.character(Theoph.2$Subject) )) +> SASxport:::assert( all(Theoph[,-1] == Theoph.2[,-1]) ) +> +> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2007-09-13 01:14:58
|
Revision: 1177 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1177&view=rev Author: warnes Date: 2007-09-12 18:14:55 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Update tests now that 'units' and 'units<-' functions no longer are included Modified Paths: -------------- trunk/SASxport/tests/Alfalfa_Test.Rout.save trunk/SASxport/tests/Theoph.Rout.save trunk/SASxport/tests/cars.Rout.save trunk/SASxport/tests/testDates.Rout.save trunk/SASxport/tests/test_fields.Rout.save trunk/SASxport/tests/xport.Rout.save trunk/SASxport/tests/xxx.Rout.save Added Paths: ----------- trunk/SASxport/tests/TestUnnamedComponents.R trunk/SASxport/tests/TestUnnamedComponents.Rout.save Modified: trunk/SASxport/tests/Alfalfa_Test.Rout.save =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-09-12 22:27:54 UTC (rev 1176) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-09-13 01:14:55 UTC (rev 1177) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.5.0 Under development (unstable) (2007-01-25 r40572) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -19,15 +19,6 @@ > ## existing SAS xport file "Alfalfa.xpt" > > library(SASxport) - -Attaching package: 'SASxport' - - - The following object(s) are masked from package:base : - - units, - units<- - > > # existing data file > SPEC <- read.xport("Alfalfa.xpt") Added: trunk/SASxport/tests/TestUnnamedComponents.R =================================================================== --- trunk/SASxport/tests/TestUnnamedComponents.R (rev 0) +++ trunk/SASxport/tests/TestUnnamedComponents.R 2007-09-13 01:14:55 UTC (rev 1177) @@ -0,0 +1,59 @@ +library(SASxport) + + +##tests +example(read.xport) +write.xport(w$test,file="a.xpt") +lookup.xport("a.xpt") + +b <- w$test +write.xport(b,file="a.xpt") +lookup.xport("a.xpt") + +write.xport(test=w$test,file="a.xpt") +lookup.xport("a.xpt") + +write.xport(test=w$test,z=w$z,file="a.xpt") +lookup.xport("a.xpt") + +write.xport(w$test,w$z,file="a.xpt") +lookup.xport("a.xpt") + +write.xport(w$test,z=w$z,file="a.xpt") +lookup.xport("a.xpt") + +write.xport(list=w,file="a.xpt") +lookup.xport("a.xpt") + +names(w) <- NULL +write.xport(w[[1]],w[[2]],file="a.xpt") +lookup.xport("a.xpt") + +names(w) <- NULL +write.xport(list=w,file="a.xpt") +lookup.xport("a.xpt") + +### Check that we catch invalid parameters +failure <- try( write.xport(5,"a.xpt") ) +SASxport:::assert( "try-error" %in% class(failure) ) + +failure <- try( write.xport(list(a=5,b=6),"a.xpt") ) +SASxport:::assert( "try-error" %in% class(failure) ) + + +# Check with different list construction function *name* +example(read.xport) +write.xport(list=base::list(w$test,w$z),file="a.xpt") +lookup.xport("a.xpt") + +# remove names +example(read.xport) +names(w) <- NULL +write.xport(list=w,file="a.xpt") +lookup.xport("a.xpt") + +# remove variable names +example(read.xport) +colnames(w[[2]]) <- c() +write.xport(list=w,file="a.xpt") +lookup.xport("a.xpt") Added: trunk/SASxport/tests/TestUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/TestUnnamedComponents.Rout.save (rev 0) +++ trunk/SASxport/tests/TestUnnamedComponents.Rout.save 2007-09-13 01:14:55 UTC (rev 1177) @@ -0,0 +1,556 @@ + +R version 2.5.0 Under development (unstable) (2007-01-25 r40572) +Copyright (C) 2007 The R Foundation for Statistical Computing +ISBN 3-900051-07-0 + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> library(SASxport) +> +> +> ##tests +> example(read.xport) + +rd.xpr> # ------- +rd.xpr> # SAS code to generate test dataset: +rd.xpr> # ------- +rd.xpr> # libname y SASV5XPT "test2.xpt"; +rd.xpr> # +rd.xpr> # PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; +rd.xpr> # PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; +rd.xpr> # data test; +rd.xpr> # LENGTH race 3 age 4; +rd.xpr> # age=30; label age="Age at Beginning of Study"; +rd.xpr> # race=2; +rd.xpr> # d1='3mar2002'd ; +rd.xpr> # dt1='3mar2002 9:31:02'dt; +rd.xpr> # t1='11:13:45't; +rd.xpr> # output; +rd.xpr> # +rd.xpr> # age=31; +rd.xpr> # race=4; +rd.xpr> # d1='3jun2002'd ; +rd.xpr> # dt1='3jun2002 9:42:07'dt; +rd.xpr> # t1='11:14:13't; +rd.xpr> # output; +rd.xpr> # format d1 mmddyy10. dt1 datetime. t1 time. race race.; +rd.xpr> # run; +rd.xpr> # data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; +rd.xpr> # DO i=1 TO 100; +rd.xpr> # x3=ranuni(3); +rd.xpr> # x4=ranuni(5); +rd.xpr> # x5=ranuni(7); +rd.xpr> # x6=ranuni(9); +rd.xpr> # x7=ranuni(11); +rd.xpr> # x8=ranuni(13); +rd.xpr> # output; +rd.xpr> # END; +rd.xpr> # DROP i; +rd.xpr> # RUN; +rd.xpr> # PROC MEANS; RUN; +rd.xpr> # PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; +rd.xpr> # ------ +rd.xpr> +rd.xpr> # Read this dataset from a local file: +rd.xpr> ## Not run: +rd.xpr> ##D w <- read.xport('test2.xpt') +rd.xpr> ## End(Not run) +rd.xpr> +rd.xpr> # Or read a copy of test2.xpt available on the web: +rd.xpr> url <- 'http://biostat.mc.vanderbilt.edu/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' + +rd.xpr> w <- read.xport(url) + +rd.xpr> # We can also get the dataset wrapped in a list +rd.xpr> w <- read.xport(url, as.list=TRUE) + +rd.xpr> ## Don't show: +rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) +> write.xport(w$test,file="a.xpt") +Warning message: +Data frame names modified to obey SAS rules in: write.xport(w$test, file = "a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `W.TEST': + dataset name type format width label nobs +W.TEST.RACE W.TEST RACE character RACE 8 2 +W.TEST.AGE W.TEST AGE numeric 8 Age at Beginning of Study 2 +W.TEST.D1 W.TEST D1 numeric 8 2 +W.TEST.DT1 W.TEST DT1 numeric 8 2 +W.TEST.T1 W.TEST T1 numeric 8 2 + +> +> b <- w$test +> write.xport(b,file="a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `B': + dataset name type format width label nobs +B.RACE B RACE character RACE 8 2 +B.AGE B AGE numeric 8 Age at Beginning of Study 2 +B.D1 B D1 numeric 8 2 +B.DT1 B DT1 numeric 8 2 +B.T1 B T1 numeric 8 2 + +> +> write.xport(test=w$test,file="a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `TEST': + dataset name type format width label nobs +TEST.RACE TEST RACE character RACE 8 2 +TEST.AGE TEST AGE numeric 8 Age at Beginning of Study 2 +TEST.D1 TEST D1 numeric 8 2 +TEST.DT1 TEST DT1 numeric 8 2 +TEST.T1 TEST T1 numeric 8 2 + +> +> write.xport(test=w$test,z=w$z,file="a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `TEST': + dataset name type format width label nobs +TEST.RACE TEST RACE character RACE 8 2 +TEST.AGE TEST AGE numeric 8 Age at Beginning of Study 2 +TEST.D1 TEST D1 numeric 8 2 +TEST.DT1 TEST DT1 numeric 8 2 +TEST.T1 TEST T1 numeric 8 2 + +Variables in data set `Z': + dataset name type format width label nobs +Z.X3 Z X3 numeric 8 100 +Z.X4 Z X4 numeric 8 100 +Z.X5 Z X5 numeric 8 100 +Z.X6 Z X6 numeric 8 100 +Z.X7 Z X7 numeric 8 100 +Z.X8 Z X8 numeric 8 100 + +> +> write.xport(w$test,w$z,file="a.xpt") +Warning message: +Data frame names modified to obey SAS rules in: write.xport(w$test, w$z, file = "a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `W.TEST': + dataset name type format width label nobs +W.TEST.RACE W.TEST RACE character RACE 8 2 +W.TEST.AGE W.TEST AGE numeric 8 Age at Beginning of Study 2 +W.TEST.D1 W.TEST D1 numeric 8 2 +W.TEST.DT1 W.TEST DT1 numeric 8 2 +W.TEST.T1 W.TEST T1 numeric 8 2 + +Variables in data set `W.Z': + dataset name type format width label nobs +W.Z.X3 W.Z X3 numeric 8 100 +W.Z.X4 W.Z X4 numeric 8 100 +W.Z.X5 W.Z X5 numeric 8 100 +W.Z.X6 W.Z X6 numeric 8 100 +W.Z.X7 W.Z X7 numeric 8 100 +W.Z.X8 W.Z X8 numeric 8 100 + +> +> write.xport(w$test,z=w$z,file="a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `W.TEST': + dataset name type format width label nobs +W.TEST.RACE W.TEST RACE character RACE 8 2 +W.TEST.AGE W.TEST AGE numeric 8 Age at Beginning of Study 2 +W.TEST.D1 W.TEST D1 numeric 8 2 +W.TEST.DT1 W.TEST DT1 numeric 8 2 +W.TEST.T1 W.TEST T1 numeric 8 2 + +Variables in data set `Z': + dataset name type format width label nobs +Z.X3 Z X3 numeric 8 100 +Z.X4 Z X4 numeric 8 100 +Z.X5 Z X5 numeric 8 100 +Z.X6 Z X6 numeric 8 100 +Z.X7 Z X7 numeric 8 100 +Z.X8 Z X8 numeric 8 100 + +> +> write.xport(list=w,file="a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `TEST': + dataset name type format width label nobs +TEST.RACE TEST RACE character RACE 8 2 +TEST.AGE TEST AGE numeric 8 Age at Beginning of Study 2 +TEST.D1 TEST D1 numeric 8 2 +TEST.DT1 TEST DT1 numeric 8 2 +TEST.T1 TEST T1 numeric 8 2 + +Variables in data set `Z': + dataset name type format width label nobs +Z.X3 Z X3 numeric 8 100 +Z.X4 Z X4 numeric 8 100 +Z.X5 Z X5 numeric 8 100 +Z.X6 Z X6 numeric 8 100 +Z.X7 Z X7 numeric 8 100 +Z.X8 Z X8 numeric 8 100 + +> +> names(w) <- NULL +> write.xport(w[[1]],w[[2]],file="a.xpt") +Warning message: +Data frame names modified to obey SAS rules in: write.xport(w[[1]], w[[2]], file = "a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `W..1..': + dataset name type format width label nobs +W..1...RACE W..1.. RACE character RACE 8 2 +W..1...AGE W..1.. AGE numeric 8 Age at Beginning of Study 2 +W..1...D1 W..1.. D1 numeric 8 2 +W..1...DT1 W..1.. DT1 numeric 8 2 +W..1...T1 W..1.. T1 numeric 8 2 + +Variables in data set `W..2..': + dataset name type format width label nobs +W..2...X3 W..2.. X3 numeric 8 100 +W..2...X4 W..2.. X4 numeric 8 100 +W..2...X5 W..2.. X5 numeric 8 100 +W..2...X6 W..2.. X6 numeric 8 100 +W..2...X7 W..2.. X7 numeric 8 100 +W..2...X8 W..2.. X8 numeric 8 100 + +> +> names(w) <- NULL +> write.xport(list=w,file="a.xpt") +Warning message: +Fewer names than datasets. Creating default names in: write.xport(list = w, file = "a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `NONAME': + dataset name type format width label nobs +NONAME.RACE NONAME RACE character RACE 8 2 +NONAME.AGE NONAME AGE numeric 8 Age at Beginning of Study 2 +NONAME.D1 NONAME D1 numeric 8 2 +NONAME.DT1 NONAME DT1 numeric 8 2 +NONAME.T1 NONAME T1 numeric 8 2 + +Variables in data set `NONAME.1': + dataset name type format width label nobs +NONAME.1.X3 NONAME.1 X3 numeric 8 100 +NONAME.1.X4 NONAME.1 X4 numeric 8 100 +NONAME.1.X5 NONAME.1 X5 numeric 8 100 +NONAME.1.X6 NONAME.1 X6 numeric 8 100 +NONAME.1.X7 NONAME.1 X7 numeric 8 100 +NONAME.1.X8 NONAME.1 X8 numeric 8 100 + +> +> ### Check that we catch invalid parameters +> failure <- try( write.xport(5,"a.xpt") ) +Error in write.xport(5, "a.xpt") : '5', 'a.xpt' are not data.frame objects. +> SASxport:::assert( "try-error" %in% class(failure) ) +> +> failure <- try( write.xport(list(a=5,b=6),"a.xpt") ) +Error in write.xport(list(a = 5, b = 6), "a.xpt") : + 'list(a = 5, b = 6)', 'a.xpt' are not data.frame objects. +> SASxport:::assert( "try-error" %in% class(failure) ) +> +> +> # Check with different list construction function *name* +> example(read.xport) + +rd.xpr> # ------- +rd.xpr> # SAS code to generate test dataset: +rd.xpr> # ------- +rd.xpr> # libname y SASV5XPT "test2.xpt"; +rd.xpr> # +rd.xpr> # PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; +rd.xpr> # PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; +rd.xpr> # data test; +rd.xpr> # LENGTH race 3 age 4; +rd.xpr> # age=30; label age="Age at Beginning of Study"; +rd.xpr> # race=2; +rd.xpr> # d1='3mar2002'd ; +rd.xpr> # dt1='3mar2002 9:31:02'dt; +rd.xpr> # t1='11:13:45't; +rd.xpr> # output; +rd.xpr> # +rd.xpr> # age=31; +rd.xpr> # race=4; +rd.xpr> # d1='3jun2002'd ; +rd.xpr> # dt1='3jun2002 9:42:07'dt; +rd.xpr> # t1='11:14:13't; +rd.xpr> # output; +rd.xpr> # format d1 mmddyy10. dt1 datetime. t1 time. race race.; +rd.xpr> # run; +rd.xpr> # data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; +rd.xpr> # DO i=1 TO 100; +rd.xpr> # x3=ranuni(3); +rd.xpr> # x4=ranuni(5); +rd.xpr> # x5=ranuni(7); +rd.xpr> # x6=ranuni(9); +rd.xpr> # x7=ranuni(11); +rd.xpr> # x8=ranuni(13); +rd.xpr> # output; +rd.xpr> # END; +rd.xpr> # DROP i; +rd.xpr> # RUN; +rd.xpr> # PROC MEANS; RUN; +rd.xpr> # PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; +rd.xpr> # ------ +rd.xpr> +rd.xpr> # Read this dataset from a local file: +rd.xpr> ## Not run: +rd.xpr> ##D w <- read.xport('test2.xpt') +rd.xpr> ## End(Not run) +rd.xpr> +rd.xpr> # Or read a copy of test2.xpt available on the web: +rd.xpr> url <- 'http://biostat.mc.vanderbilt.edu/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' + +rd.xpr> w <- read.xport(url) + +rd.xpr> # We can also get the dataset wrapped in a list +rd.xpr> w <- read.xport(url, as.list=TRUE) + +rd.xpr> ## Don't show: +rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) +> write.xport(list=base::list(w$test,w$z),file="a.xpt") +Warning message: +Fewer names than datasets. Creating default names in: write.xport(list = base::list(w$test, w$z), file = "a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `NONAME': + dataset name type format width label nobs +NONAME.RACE NONAME RACE character RACE 8 2 +NONAME.AGE NONAME AGE numeric 8 Age at Beginning of Study 2 +NONAME.D1 NONAME D1 numeric 8 2 +NONAME.DT1 NONAME DT1 numeric 8 2 +NONAME.T1 NONAME T1 numeric 8 2 + +Variables in data set `NONAME.1': + dataset name type format width label nobs +NONAME.1.X3 NONAME.1 X3 numeric 8 100 +NONAME.1.X4 NONAME.1 X4 numeric 8 100 +NONAME.1.X5 NONAME.1 X5 numeric 8 100 +NONAME.1.X6 NONAME.1 X6 numeric 8 100 +NONAME.1.X7 NONAME.1 X7 numeric 8 100 +NONAME.1.X8 NONAME.1 X8 numeric 8 100 + +> +> # remove names +> example(read.xport) + +rd.xpr> # ------- +rd.xpr> # SAS code to generate test dataset: +rd.xpr> # ------- +rd.xpr> # libname y SASV5XPT "test2.xpt"; +rd.xpr> # +rd.xpr> # PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; +rd.xpr> # PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; +rd.xpr> # data test; +rd.xpr> # LENGTH race 3 age 4; +rd.xpr> # age=30; label age="Age at Beginning of Study"; +rd.xpr> # race=2; +rd.xpr> # d1='3mar2002'd ; +rd.xpr> # dt1='3mar2002 9:31:02'dt; +rd.xpr> # t1='11:13:45't; +rd.xpr> # output; +rd.xpr> # +rd.xpr> # age=31; +rd.xpr> # race=4; +rd.xpr> # d1='3jun2002'd ; +rd.xpr> # dt1='3jun2002 9:42:07'dt; +rd.xpr> # t1='11:14:13't; +rd.xpr> # output; +rd.xpr> # format d1 mmddyy10. dt1 datetime. t1 time. race race.; +rd.xpr> # run; +rd.xpr> # data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; +rd.xpr> # DO i=1 TO 100; +rd.xpr> # x3=ranuni(3); +rd.xpr> # x4=ranuni(5); +rd.xpr> # x5=ranuni(7); +rd.xpr> # x6=ranuni(9); +rd.xpr> # x7=ranuni(11); +rd.xpr> # x8=ranuni(13); +rd.xpr> # output; +rd.xpr> # END; +rd.xpr> # DROP i; +rd.xpr> # RUN; +rd.xpr> # PROC MEANS; RUN; +rd.xpr> # PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; +rd.xpr> # ------ +rd.xpr> +rd.xpr> # Read this dataset from a local file: +rd.xpr> ## Not run: +rd.xpr> ##D w <- read.xport('test2.xpt') +rd.xpr> ## End(Not run) +rd.xpr> +rd.xpr> # Or read a copy of test2.xpt available on the web: +rd.xpr> url <- 'http://biostat.mc.vanderbilt.edu/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' + +rd.xpr> w <- read.xport(url) + +rd.xpr> # We can also get the dataset wrapped in a list +rd.xpr> w <- read.xport(url, as.list=TRUE) + +rd.xpr> ## Don't show: +rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) +> names(w) <- NULL +> write.xport(list=w,file="a.xpt") +Warning message: +Fewer names than datasets. Creating default names in: write.xport(list = w, file = "a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `NONAME': + dataset name type format width label nobs +NONAME.RACE NONAME RACE character RACE 8 2 +NONAME.AGE NONAME AGE numeric 8 Age at Beginning of Study 2 +NONAME.D1 NONAME D1 numeric 8 2 +NONAME.DT1 NONAME DT1 numeric 8 2 +NONAME.T1 NONAME T1 numeric 8 2 + +Variables in data set `NONAME.1': + dataset name type format width label nobs +NONAME.1.X3 NONAME.1 X3 numeric 8 100 +NONAME.1.X4 NONAME.1 X4 numeric 8 100 +NONAME.1.X5 NONAME.1 X5 numeric 8 100 +NONAME.1.X6 NONAME.1 X6 numeric 8 100 +NONAME.1.X7 NONAME.1 X7 numeric 8 100 +NONAME.1.X8 NONAME.1 X8 numeric 8 100 + +> +> # remove variable names +> example(read.xport) + +rd.xpr> # ------- +rd.xpr> # SAS code to generate test dataset: +rd.xpr> # ------- +rd.xpr> # libname y SASV5XPT "test2.xpt"; +rd.xpr> # +rd.xpr> # PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; +rd.xpr> # PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; +rd.xpr> # data test; +rd.xpr> # LENGTH race 3 age 4; +rd.xpr> # age=30; label age="Age at Beginning of Study"; +rd.xpr> # race=2; +rd.xpr> # d1='3mar2002'd ; +rd.xpr> # dt1='3mar2002 9:31:02'dt; +rd.xpr> # t1='11:13:45't; +rd.xpr> # output; +rd.xpr> # +rd.xpr> # age=31; +rd.xpr> # race=4; +rd.xpr> # d1='3jun2002'd ; +rd.xpr> # dt1='3jun2002 9:42:07'dt; +rd.xpr> # t1='11:14:13't; +rd.xpr> # output; +rd.xpr> # format d1 mmddyy10. dt1 datetime. t1 time. race race.; +rd.xpr> # run; +rd.xpr> # data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; +rd.xpr> # DO i=1 TO 100; +rd.xpr> # x3=ranuni(3); +rd.xpr> # x4=ranuni(5); +rd.xpr> # x5=ranuni(7); +rd.xpr> # x6=ranuni(9); +rd.xpr> # x7=ranuni(11); +rd.xpr> # x8=ranuni(13); +rd.xpr> # output; +rd.xpr> # END; +rd.xpr> # DROP i; +rd.xpr> # RUN; +rd.xpr> # PROC MEANS; RUN; +rd.xpr> # PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; +rd.xpr> # ------ +rd.xpr> +rd.xpr> # Read this dataset from a local file: +rd.xpr> ## Not run: +rd.xpr> ##D w <- read.xport('test2.xpt') +rd.xpr> ## End(Not run) +rd.xpr> +rd.xpr> # Or read a copy of test2.xpt available on the web: +rd.xpr> url <- 'http://biostat.mc.vanderbilt.edu/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' + +rd.xpr> w <- read.xport(url) + +rd.xpr> # We can also get the dataset wrapped in a list +rd.xpr> w <- read.xport(url, as.list=TRUE) + +rd.xpr> ## Don't show: +rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) +> colnames(w[[2]]) <- c() +> write.xport(list=w,file="a.xpt") +Warning messages: +1: Unnamed variables detected. Creating default variable names in: write.xport(list = w, file = "a.xpt") +2: Variable names modified to obey SAS rules in: write.xport(list = w, file = "a.xpt") +> lookup.xport("a.xpt") + +SAS xport file +-------------- +Filename: `a.xpt' + +Variables in data set `TEST': + dataset name type format width label nobs +TEST.RACE TEST RACE character RACE 8 2 +TEST.AGE TEST AGE numeric 8 Age at Beginning of Study 2 +TEST.D1 TEST D1 numeric 8 2 +TEST.DT1 TEST DT1 numeric 8 2 +TEST.T1 TEST T1 numeric 8 2 + +Variables in data set `Z': + dataset name type format width label nobs +Z.X6 Z X6 numeric 8 100 +Z.NONAME Z NONAME numeric 8 100 +Z.NONAME_1 Z NONAME_1 numeric 8 100 +Z.NONAME_2 Z NONAME_2 numeric 8 100 +Z.NONAME_3 Z NONAME_3 numeric 8 100 +Z.NONAME_4 Z NONAME_4 numeric 8 100 + +> Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2007-09-12 22:27:54 UTC (rev 1176) +++ trunk/SASxport/tests/Theoph.Rout.save 2007-09-13 01:14:55 UTC (rev 1177) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.5.0 Under development (unstable) (2007-01-25 r40572) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -21,15 +21,6 @@ > #### > > library(SASxport) - -Attaching package: 'SASxport' - - - The following object(s) are masked from package:base : - - units, - units<- - > > write.xport(Theoph,file="theoph.xpt") > Theoph.2 <- read.xport("theoph.xpt") Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2007-09-12 22:27:54 UTC (rev 1176) +++ trunk/SASxport/tests/cars.Rout.save 2007-09-13 01:14:55 UTC (rev 1177) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.5.0 Under development (unstable) (2007-01-25 r40572) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,15 +16,6 @@ Type 'q()' to quit R. > library(SASxport) - -Attaching package: 'SASxport' - - - The following object(s) are masked from package:base : - - units, - units<- - > > > cars <- read.table(file="cars.sas", skip=3, nrows=26, Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2007-09-12 22:27:54 UTC (rev 1176) +++ trunk/SASxport/tests/testDates.Rout.save 2007-09-13 01:14:55 UTC (rev 1177) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.5.0 Under development (unstable) (2007-01-25 r40572) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,15 +16,6 @@ Type 'q()' to quit R. > library(SASxport) - -Attaching package: 'SASxport' - - - The following object(s) are masked from package:base : - - units, - units<- - > > ## Create a small data set containing dates, times, and date-times > @@ -47,6 +38,8 @@ 5 5 e 1992-02-01 1992-02-01 16:56:26 > > write.xport( DATETIME=temp, file="datetime.xpt") +Warning message: +Variable names modified to obey SAS rules in: write.xport(DATETIME = temp, file = "datetime.xpt") > temp2 <- read.xport(file="datetime.xpt", names.tolower=FALSE) > > print(temp2) Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2007-09-12 22:27:54 UTC (rev 1176) +++ trunk/SASxport/tests/test_fields.Rout.save 2007-09-13 01:14:55 UTC (rev 1177) @@ -1,5 +1,5 @@ -R version 2.6.0 Under development (unstable) (2007-08-04 r42421) +R version 2.5.0 Under development (unstable) (2007-01-25 r40572) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,15 +16,6 @@ Type 'q()' to quit R. > library(SASxport) - -Attaching package: 'SASxport' - - - The following object(s) are masked from package:base : - - units, - units<- - > > ## Call C-level test routines > Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2007-09-12 22:27:54 UTC (rev 1176) +++ trunk/SASxport/tests/xport.Rout.save 2007-09-13 01:14:55 UTC (rev 1177) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.5.0 Under development (unstable) (2007-01-25 r40572) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,15 +16,6 @@ Type 'q()' to quit R. > library(SASxport) - -Attaching package: 'SASxport' - - - The following object(s) are masked from package:base : - - units, - units<- - > > lookup.xport("Alfalfa.xpt") Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2007-09-12 22:27:54 UTC (rev 1176) +++ trunk/SASxport/tests/xxx.Rout.save 2007-09-13 01:14:55 UTC (rev 1177) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.5.0 Under development (unstable) (2007-01-25 r40572) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,15 +16,6 @@ Type 'q()' to quit R. > library(SASxport) - -Attaching package: 'SASxport' - - - The following object(s) are masked from package:base : - - units, - units<- - > > ## manually create a data set > abc <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2007-10-01 20:09:21
|
Revision: 1192 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1192&view=rev Author: warnes Date: 2007-10-01 13:09:03 -0700 (Mon, 01 Oct 2007) Log Message: ----------- Update saved R output to include startup message Modified Paths: -------------- trunk/SASxport/tests/Alfalfa_Test.Rout.save trunk/SASxport/tests/TestUnnamedComponents.Rout.save trunk/SASxport/tests/Theoph.Rout.save trunk/SASxport/tests/cars.Rout.save trunk/SASxport/tests/testDates.Rout.save trunk/SASxport/tests/test_fields.Rout.save trunk/SASxport/tests/xport.Rout.save trunk/SASxport/tests/xxx.Rout.save Modified: trunk/SASxport/tests/Alfalfa_Test.Rout.save =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-09-25 19:58:05 UTC (rev 1191) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-10-01 20:09:03 UTC (rev 1192) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.6.0 beta (2007-09-24 r42966) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -19,6 +19,12 @@ > ## existing SAS xport file "Alfalfa.xpt" > > library(SASxport) + +Loaded SASxport version 1.1.1 (2007-09-25). + + Updates and technical support available from Random Technologies, LLC + <http://random-technologies-llc.com/contact> + > > # existing data file > SPEC <- read.xport("Alfalfa.xpt") Modified: trunk/SASxport/tests/TestUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/TestUnnamedComponents.Rout.save 2007-09-25 19:58:05 UTC (rev 1191) +++ trunk/SASxport/tests/TestUnnamedComponents.Rout.save 2007-10-01 20:09:03 UTC (rev 1192) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.6.0 beta (2007-09-24 r42966) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,6 +16,12 @@ Type 'q()' to quit R. > library(SASxport) + +Loaded SASxport version 1.1.1 (2007-09-25). + + Updates and technical support available from Random Technologies, LLC + <http://random-technologies-llc.com/contact> + > > > ##tests @@ -85,7 +91,8 @@ rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) > write.xport(w$test,file="a.xpt") Warning message: -Data frame names modified to obey SAS rules in: write.xport(w$test, file = "a.xpt") +In write.xport(w$test, file = "a.xpt") : + Data frame names modified to obey SAS rules > lookup.xport("a.xpt") SAS xport file @@ -161,7 +168,8 @@ > > write.xport(w$test,w$z,file="a.xpt") Warning message: -Data frame names modified to obey SAS rules in: write.xport(w$test, w$z, file = "a.xpt") +In write.xport(w$test, w$z, file = "a.xpt") : + Data frame names modified to obey SAS rules > lookup.xport("a.xpt") SAS xport file @@ -263,7 +271,8 @@ > names(w) <- NULL > write.xport(w[[1]],w[[2]],file="a.xpt") Warning message: -Data frame names modified to obey SAS rules in: write.xport(w[[1]], w[[2]], file = "a.xpt") +In write.xport(w[[1]], w[[2]], file = "a.xpt") : + Data frame names modified to obey SAS rules > lookup.xport("a.xpt") SAS xport file @@ -291,7 +300,8 @@ > names(w) <- NULL > write.xport(list=w,file="a.xpt") Warning message: -Replacing missing or invalid dataset names in: write.xport(list = w, file = "a.xpt") +In write.xport(list = w, file = "a.xpt") : + Replacing missing or invalid dataset names > lookup.xport("a.xpt") SAS xport file @@ -366,12 +376,13 @@ > > ### Check that we catch invalid parameters > failure <- try( write.xport(5,"a.xpt") ) -Error in write.xport(5, "a.xpt") : '5', 'a.xpt' are not data.frame objects. +Error in write.xport(5, "a.xpt") : + '5', 'a.xpt' are not data.frame objects. > SASxport:::assert( "try-error" %in% class(failure) ) > > failure <- try( write.xport(list(a=5,b=6),"a.xpt") ) Error in write.xport(list(a = 5, b = 6), "a.xpt") : - 'list(a = 5, b = 6)', 'a.xpt' are not data.frame objects. + 'list(a = 5, b = 6)', 'a.xpt' are not data.frame objects. > SASxport:::assert( "try-error" %in% class(failure) ) > > @@ -442,7 +453,8 @@ rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) > write.xport(list=base::list(w$test,w$z),file="a.xpt") Warning message: -Replacing missing or invalid dataset names in: write.xport(list = base::list(w$test, w$z), file = "a.xpt") +In write.xport(list = base::list(w$test, w$z), file = "a.xpt") : + Replacing missing or invalid dataset names > lookup.xport("a.xpt") SAS xport file @@ -535,7 +547,8 @@ > names(w) <- NULL > write.xport(list=w,file="a.xpt") Warning message: -Replacing missing or invalid dataset names in: write.xport(list = w, file = "a.xpt") +In write.xport(list = w, file = "a.xpt") : + Replacing missing or invalid dataset names > lookup.xport("a.xpt") SAS xport file @@ -676,7 +689,8 @@ > colnames(w[[2]]) <- rep("", length=ncol(w[[2]])) > write.xport(list=w,file="a.xpt") Warning message: -Unnamed variables detected, using default names in: write.xport(list = w, file = "a.xpt") +In write.xport(list = w, file = "a.xpt") : + Unnamed variables detected, using default names > lookup.xport("a.xpt") SAS xport file Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2007-09-25 19:58:05 UTC (rev 1191) +++ trunk/SASxport/tests/Theoph.Rout.save 2007-10-01 20:09:03 UTC (rev 1192) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.6.0 beta (2007-09-24 r42966) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -21,6 +21,12 @@ > #### > > library(SASxport) + +Loaded SASxport version 1.1.1 (2007-09-25). + + Updates and technical support available from Random Technologies, LLC + <http://random-technologies-llc.com/contact> + > > write.xport(Theoph,file="theoph.xpt") > Theoph.2 <- read.xport("theoph.xpt") Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2007-09-25 19:58:05 UTC (rev 1191) +++ trunk/SASxport/tests/cars.Rout.save 2007-10-01 20:09:03 UTC (rev 1192) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.6.0 beta (2007-09-24 r42966) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,6 +16,12 @@ Type 'q()' to quit R. > library(SASxport) + +Loaded SASxport version 1.1.1 (2007-09-25). + + Updates and technical support available from Random Technologies, LLC + <http://random-technologies-llc.com/contact> + > > > cars <- read.table(file="cars.sas", skip=3, nrows=26, Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2007-09-25 19:58:05 UTC (rev 1191) +++ trunk/SASxport/tests/testDates.Rout.save 2007-10-01 20:09:03 UTC (rev 1192) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.6.0 beta (2007-09-24 r42966) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,6 +16,12 @@ Type 'q()' to quit R. > library(SASxport) + +Loaded SASxport version 1.1.1 (2007-09-25). + + Updates and technical support available from Random Technologies, LLC + <http://random-technologies-llc.com/contact> + > > ## Create a small data set containing dates, times, and date-times > @@ -39,7 +45,8 @@ > > write.xport( DATETIME=temp, file="datetime.xpt") Warning message: -Variable names modified to obey SAS rules in: write.xport(DATETIME = temp, file = "datetime.xpt") +In write.xport(DATETIME = temp, file = "datetime.xpt") : + Variable names modified to obey SAS rules > temp2 <- read.xport(file="datetime.xpt", names.tolower=FALSE) > > print(temp2) Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2007-09-25 19:58:05 UTC (rev 1191) +++ trunk/SASxport/tests/test_fields.Rout.save 2007-10-01 20:09:03 UTC (rev 1192) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.6.0 beta (2007-09-24 r42966) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,6 +16,12 @@ Type 'q()' to quit R. > library(SASxport) + +Loaded SASxport version 1.1.1 (2007-09-25). + + Updates and technical support available from Random Technologies, LLC + <http://random-technologies-llc.com/contact> + > > ## Call C-level test routines > Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2007-09-25 19:58:05 UTC (rev 1191) +++ trunk/SASxport/tests/xport.Rout.save 2007-10-01 20:09:03 UTC (rev 1192) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.6.0 beta (2007-09-24 r42966) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,6 +16,12 @@ Type 'q()' to quit R. > library(SASxport) + +Loaded SASxport version 1.1.1 (2007-09-25). + + Updates and technical support available from Random Technologies, LLC + <http://random-technologies-llc.com/contact> + > > lookup.xport("Alfalfa.xpt") Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2007-09-25 19:58:05 UTC (rev 1191) +++ trunk/SASxport/tests/xxx.Rout.save 2007-10-01 20:09:03 UTC (rev 1192) @@ -1,5 +1,5 @@ -R version 2.5.1 (2007-06-27) +R version 2.6.0 beta (2007-09-24 r42966) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 @@ -16,6 +16,12 @@ Type 'q()' to quit R. > library(SASxport) + +Loaded SASxport version 1.1.1 (2007-09-25). + + Updates and technical support available from Random Technologies, LLC + <http://random-technologies-llc.com/contact> + > > ## manually create a data set > abc <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2007-10-29 15:32:54
|
Revision: 1197 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1197&view=rev Author: warnes Date: 2007-10-29 08:32:50 -0700 (Mon, 29 Oct 2007) Log Message: ----------- Commit changes to stored output to match changed package load message Modified Paths: -------------- trunk/SASxport/tests/Alfalfa_Test.Rout.save trunk/SASxport/tests/TestUnnamedComponents.Rout.save trunk/SASxport/tests/Theoph.Rout.save trunk/SASxport/tests/cars.Rout.save trunk/SASxport/tests/testDates.Rout.save trunk/SASxport/tests/test_fields.Rout.save trunk/SASxport/tests/xport.Rout.save trunk/SASxport/tests/xxx.Rout.save Modified: trunk/SASxport/tests/Alfalfa_Test.Rout.save =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-10-22 02:24:28 UTC (rev 1196) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-10-29 15:32:50 UTC (rev 1197) @@ -23,7 +23,7 @@ Loaded SASxport version 1.1.1 (2007-09-25). Updates and technical support available from Random Technologies, LLC - <http://random-technologies-llc.com/contact> + <http://random-technologies-llc.com/products/SASxport> Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/TestUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/TestUnnamedComponents.Rout.save 2007-10-22 02:24:28 UTC (rev 1196) +++ trunk/SASxport/tests/TestUnnamedComponents.Rout.save 2007-10-29 15:32:50 UTC (rev 1197) @@ -20,7 +20,7 @@ Loaded SASxport version 1.1.1 (2007-09-25). Updates and technical support available from Random Technologies, LLC - <http://random-technologies-llc.com/contact> + <http://random-technologies-llc.com/products/SASxport> Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2007-10-22 02:24:28 UTC (rev 1196) +++ trunk/SASxport/tests/Theoph.Rout.save 2007-10-29 15:32:50 UTC (rev 1197) @@ -25,7 +25,7 @@ Loaded SASxport version 1.1.1 (2007-09-25). Updates and technical support available from Random Technologies, LLC - <http://random-technologies-llc.com/contact> + <http://random-technologies-llc.com/products/SASxport> Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2007-10-22 02:24:28 UTC (rev 1196) +++ trunk/SASxport/tests/cars.Rout.save 2007-10-29 15:32:50 UTC (rev 1197) @@ -20,7 +20,7 @@ Loaded SASxport version 1.1.1 (2007-09-25). Updates and technical support available from Random Technologies, LLC - <http://random-technologies-llc.com/contact> + <http://random-technologies-llc.com/products/SASxport> Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2007-10-22 02:24:28 UTC (rev 1196) +++ trunk/SASxport/tests/testDates.Rout.save 2007-10-29 15:32:50 UTC (rev 1197) @@ -20,7 +20,7 @@ Loaded SASxport version 1.1.1 (2007-09-25). Updates and technical support available from Random Technologies, LLC - <http://random-technologies-llc.com/contact> + <http://random-technologies-llc.com/products/SASxport> Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2007-10-22 02:24:28 UTC (rev 1196) +++ trunk/SASxport/tests/test_fields.Rout.save 2007-10-29 15:32:50 UTC (rev 1197) @@ -20,7 +20,7 @@ Loaded SASxport version 1.1.1 (2007-09-25). Updates and technical support available from Random Technologies, LLC - <http://random-technologies-llc.com/contact> + <http://random-technologies-llc.com/products/SASxport> Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2007-10-22 02:24:28 UTC (rev 1196) +++ trunk/SASxport/tests/xport.Rout.save 2007-10-29 15:32:50 UTC (rev 1197) @@ -20,7 +20,7 @@ Loaded SASxport version 1.1.1 (2007-09-25). Updates and technical support available from Random Technologies, LLC - <http://random-technologies-llc.com/contact> + <http://random-technologies-llc.com/products/SASxport> Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2007-10-22 02:24:28 UTC (rev 1196) +++ trunk/SASxport/tests/xxx.Rout.save 2007-10-29 15:32:50 UTC (rev 1197) @@ -20,7 +20,7 @@ Loaded SASxport version 1.1.1 (2007-09-25). Updates and technical support available from Random Technologies, LLC - <http://random-technologies-llc.com/contact> + <http://random-technologies-llc.com/products/SASxport> Type `?SASxport' for usage information. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2007-11-07 19:01:05
|
Revision: 1225 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1225&view=rev Author: warnes Date: 2007-11-07 11:01:02 -0800 (Wed, 07 Nov 2007) Log Message: ----------- Update version number Modified Paths: -------------- trunk/SASxport/tests/Alfalfa_Test.Rout.save trunk/SASxport/tests/TestUnnamedComponents.Rout.save trunk/SASxport/tests/Theoph.Rout.save trunk/SASxport/tests/cars.Rout.save trunk/SASxport/tests/testDates.Rout.save trunk/SASxport/tests/testNegative.Rout.save trunk/SASxport/tests/testNumeric.Rout.save trunk/SASxport/tests/test_fields.Rout.save trunk/SASxport/tests/xport.Rout.save trunk/SASxport/tests/xxx.Rout.save Modified: trunk/SASxport/tests/Alfalfa_Test.Rout.save =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-11-07 18:59:20 UTC (rev 1224) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2007-11-07 19:01:02 UTC (rev 1225) @@ -20,7 +20,7 @@ > > library(SASxport) -Loaded SASxport version 1.2.0 (2007-11-01). +Loaded SASxport version 1.2.2 (2007-11-07). Updates and technical support available from Random Technologies, LLC <http://random-technologies-llc.com/products/SASxport> Modified: trunk/SASxport/tests/TestUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/TestUnnamedComponents.Rout.save 2007-11-07 18:59:20 UTC (rev 1224) +++ trunk/SASxport/tests/TestUnnamedComponents.Rout.save 2007-11-07 19:01:02 UTC (rev 1225) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.2.0 (2007-11-01). +Loaded SASxport version 1.2.2 (2007-11-07). Updates and technical support available from Random Technologies, LLC <http://random-technologies-llc.com/products/SASxport> Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2007-11-07 18:59:20 UTC (rev 1224) +++ trunk/SASxport/tests/Theoph.Rout.save 2007-11-07 19:01:02 UTC (rev 1225) @@ -22,7 +22,7 @@ > > library(SASxport) -Loaded SASxport version 1.2.0 (2007-11-01). +Loaded SASxport version 1.2.2 (2007-11-07). Updates and technical support available from Random Technologies, LLC <http://random-technologies-llc.com/products/SASxport> Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2007-11-07 18:59:20 UTC (rev 1224) +++ trunk/SASxport/tests/cars.Rout.save 2007-11-07 19:01:02 UTC (rev 1225) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.2.0 (2007-11-01). +Loaded SASxport version 1.2.2 (2007-11-07). Updates and technical support available from Random Technologies, LLC <http://random-technologies-llc.com/products/SASxport> Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2007-11-07 18:59:20 UTC (rev 1224) +++ trunk/SASxport/tests/testDates.Rout.save 2007-11-07 19:01:02 UTC (rev 1225) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.2.0 (2007-11-01). +Loaded SASxport version 1.2.2 (2007-11-07). Updates and technical support available from Random Technologies, LLC <http://random-technologies-llc.com/products/SASxport> Modified: trunk/SASxport/tests/testNegative.Rout.save =================================================================== --- trunk/SASxport/tests/testNegative.Rout.save 2007-11-07 18:59:20 UTC (rev 1224) +++ trunk/SASxport/tests/testNegative.Rout.save 2007-11-07 19:01:02 UTC (rev 1225) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.2.0 (2007-11-01). +Loaded SASxport version 1.2.2 (2007-11-07). Updates and technical support available from Random Technologies, LLC <http://random-technologies-llc.com/products/SASxport> Modified: trunk/SASxport/tests/testNumeric.Rout.save =================================================================== --- trunk/SASxport/tests/testNumeric.Rout.save 2007-11-07 18:59:20 UTC (rev 1224) +++ trunk/SASxport/tests/testNumeric.Rout.save 2007-11-07 19:01:02 UTC (rev 1225) @@ -89,4 +89,4 @@ > > proc.time() user system elapsed - 0.994 0.071 1.106 + 1.123 0.119 2.017 Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2007-11-07 18:59:20 UTC (rev 1224) +++ trunk/SASxport/tests/test_fields.Rout.save 2007-11-07 19:01:02 UTC (rev 1225) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.2.0 (2007-11-01). +Loaded SASxport version 1.2.2 (2007-11-07). Updates and technical support available from Random Technologies, LLC <http://random-technologies-llc.com/products/SASxport> Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2007-11-07 18:59:20 UTC (rev 1224) +++ trunk/SASxport/tests/xport.Rout.save 2007-11-07 19:01:02 UTC (rev 1225) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.2.0 (2007-11-01). +Loaded SASxport version 1.2.2 (2007-11-07). Updates and technical support available from Random Technologies, LLC <http://random-technologies-llc.com/products/SASxport> Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2007-11-07 18:59:20 UTC (rev 1224) +++ trunk/SASxport/tests/xxx.Rout.save 2007-11-07 19:01:02 UTC (rev 1225) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.2.0 (2007-11-01). +Loaded SASxport version 1.2.2 (2007-11-07). Updates and technical support available from Random Technologies, LLC <http://random-technologies-llc.com/products/SASxport> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |