r-gregmisc-users Mailing List for R gregmisc package (Page 15)
Brought to you by:
warnes
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(12) |
Apr
(5) |
May
(3) |
Jun
(5) |
Jul
(2) |
Aug
(5) |
Sep
(7) |
Oct
(15) |
Nov
(34) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(3) |
Feb
(16) |
Mar
(28) |
Apr
(5) |
May
|
Jun
(5) |
Jul
(9) |
Aug
(50) |
Sep
(29) |
Oct
(9) |
Nov
(25) |
Dec
(7) |
2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(8) |
May
(26) |
Jun
(11) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
(26) |
Jun
|
Jul
(10) |
Aug
(6) |
Sep
|
Oct
(7) |
Nov
(3) |
Dec
(2) |
2010 |
Jan
(45) |
Feb
(11) |
Mar
|
Apr
(1) |
May
(8) |
Jun
(7) |
Jul
(3) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(9) |
Dec
(1) |
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(14) |
Sep
(29) |
Oct
(3) |
Nov
|
Dec
(3) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
(6) |
Jun
(59) |
Jul
|
Aug
(8) |
Sep
(21) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
(10) |
Apr
|
May
(18) |
Jun
(25) |
Jul
(18) |
Aug
(1) |
Sep
(6) |
Oct
(28) |
Nov
(4) |
Dec
(13) |
2014 |
Jan
(7) |
Feb
(5) |
Mar
(4) |
Apr
(36) |
May
(3) |
Jun
(7) |
Jul
(46) |
Aug
(14) |
Sep
(12) |
Oct
(2) |
Nov
|
Dec
(12) |
2015 |
Jan
(4) |
Feb
|
Mar
|
Apr
(80) |
May
(36) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <wa...@us...> - 2013-06-27 21:14:34
|
Revision: 1677 http://sourceforge.net/p/r-gregmisc/code/1677 Author: warnes Date: 2013-06-27 21:14:31 +0000 (Thu, 27 Jun 2013) Log Message: ----------- Update with tests for only 1 row/column separator Modified Paths: -------------- trunk/gplots/tests/heatmap2Test.Rout.save Modified: trunk/gplots/tests/heatmap2Test.Rout.save =================================================================== --- trunk/gplots/tests/heatmap2Test.Rout.save 2013-06-27 20:51:27 UTC (rev 1676) +++ trunk/gplots/tests/heatmap2Test.Rout.save 2013-06-27 21:14:31 UTC (rev 1677) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) +R version 3.0.1 (2013-05-16) -- "Good Sport" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -25,24 +24,24 @@ Attaching package: 'gdata' -The following object(s) are masked from 'package:stats': +The following object is masked from 'package:stats': nobs -The following object(s) are masked from 'package:utils': +The following object is masked from 'package:utils': object.size Loading required package: caTools -Loading required package: bitops Loading required package: grid Loading required package: KernSmooth KernSmooth 2.23 loaded Copyright M. P. Wand 1997-2009 +Loading required package: MASS Attaching package: 'gplots' -The following object(s) are masked from 'package:stats': +The following object is masked from 'package:stats': lowess @@ -236,7 +235,13 @@ ..$ high : num [1:256] -3.19 -3.16 -3.14 -3.11 -3.09 ... ..$ color: Factor w/ 254 levels "#80FFFFFF","#81FFFFFF",..: 1 1 2 3 4 5 6 7 8 9 ... > +> ## Test row and column separators +> heatmap.2(x,dendrogram="col", colsep=1) ## one colsep +> heatmap.2(x,dendrogram="col", rowsep=1) ## one rowsep > +> heatmap.2(x,dendrogram="col", colsep=1:2) ## two colseps +> heatmap.2(x,dendrogram="col", rowsep=1:2) ## two rowseps +> > proc.time() user system elapsed - 1.427 0.067 1.487 + 5.104 0.356 5.478 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-06-27 20:51:30
|
Revision: 1676 http://sourceforge.net/p/r-gregmisc/code/1676 Author: warnes Date: 2013-06-27 20:51:27 +0000 (Thu, 27 Jun 2013) Log Message: ----------- Fix typo Modified Paths: -------------- trunk/gplots/man/plotmeans.Rd Modified: trunk/gplots/man/plotmeans.Rd =================================================================== --- trunk/gplots/man/plotmeans.Rd 2013-06-27 20:47:30 UTC (rev 1675) +++ trunk/gplots/man/plotmeans.Rd 2013-06-27 20:51:27 UTC (rev 1676) @@ -20,7 +20,7 @@ %} \arguments{ - \item{formula}{symbolic expression specifying the outcome (continious) + \item{formula}{symbolic expression specifying the outcome (continuous) and grouping variable (factor). See lm() for details.} \item{data}{optional data frame containing the variables in the model.} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-06-27 20:47:32
|
Revision: 1675 http://sourceforge.net/p/r-gregmisc/code/1675 Author: warnes Date: 2013-06-27 20:47:30 +0000 (Thu, 27 Jun 2013) Log Message: ----------- Add test for one row/column separator Modified Paths: -------------- trunk/gplots/tests/heatmap2Test.R Modified: trunk/gplots/tests/heatmap2Test.R =================================================================== --- trunk/gplots/tests/heatmap2Test.R 2013-06-27 20:28:48 UTC (rev 1674) +++ trunk/gplots/tests/heatmap2Test.R 2013-06-27 20:47:30 UTC (rev 1675) @@ -50,3 +50,9 @@ str(hv) # the two re-ordering index vectors +## Test row and column separators +heatmap.2(x,dendrogram="col", colsep=1) ## one colsep +heatmap.2(x,dendrogram="col", rowsep=1) ## one rowsep + +heatmap.2(x,dendrogram="col", colsep=1:2) ## two colseps +heatmap.2(x,dendrogram="col", rowsep=1:2) ## two rowseps This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-06-27 20:28:51
|
Revision: 1674 http://sourceforge.net/p/r-gregmisc/code/1674 Author: warnes Date: 2013-06-27 20:28:48 +0000 (Thu, 27 Jun 2013) Log Message: ----------- Add more in-line comments Modified Paths: -------------- trunk/gplots/R/baseOf.R Modified: trunk/gplots/R/baseOf.R =================================================================== --- trunk/gplots/R/baseOf.R 2013-06-27 20:20:46 UTC (rev 1673) +++ trunk/gplots/R/baseOf.R 2013-06-27 20:28:48 UTC (rev 1674) @@ -1,8 +1,5 @@ + # transform base -# baseOf transforms a value (v) of base 10 into a an -# array of factors for v's representation to another -# base (b). This is used later in the code to identify -# all the different intersections. # v = value of base 10 to be transformed # b = new base # l = minimal length of returned array (default is 1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-06-27 20:20:48
|
Revision: 1673 http://sourceforge.net/p/r-gregmisc/code/1673 Author: warnes Date: 2013-06-27 20:20:46 +0000 (Thu, 27 Jun 2013) Log Message: ----------- Modify sinkplot to use a local environement to store its information instead of the global environment. Modified Paths: -------------- trunk/gplots/R/sinkplot.R trunk/gplots/man/sinkplot.Rd Modified: trunk/gplots/R/sinkplot.R =================================================================== --- trunk/gplots/R/sinkplot.R 2013-06-14 20:58:06 UTC (rev 1672) +++ trunk/gplots/R/sinkplot.R 2013-06-27 20:20:46 UTC (rev 1673) @@ -1,18 +1,19 @@ # $Id$ - +sinkplotEnv <-new.env() + sinkplot <- function(operation=c("start","plot","cancel"),...) { operation <- match.arg(operation) if( operation=="start" ) { - if (exists(".sinkplot.conn", envir=globalenv()) && - get(".sinkplot.conn", envir=globalenv()) ) + if (exists(".sinkplot.conn", envir=sinkplotEnv) && + get(".sinkplot.conn", envir=sinkplotEnv) ) stop("sinkplot already in force") .sinkplot.conn <- textConnection(".sinkplot.data", "w", local=FALSE) - assign(x=".sinkplot.conn", value=.sinkplot.conn, envir=globalenv()) + assign(x=".sinkplot.conn", value=.sinkplot.conn, envir=sinkplotEnv) on.exit(sink()) sink(.sinkplot.conn) @@ -20,23 +21,24 @@ } else { - if (!exists(".sinkplot.conn", envir=globalenv()) || !.sinkplot.conn ) + if (!exists(".sinkplot.conn", envir=sinkplotEnv) || + !get(".sinkplot.conn", envir=sinkplotEnv) ) stop("No sinkplot currently in force") sink() - data <- get(".sinkplot.data", envir=globalenv()) + data <- get(".sinkplot.data", envir=sinkplotEnv) if( operation=="plot" ) textplot( paste( data, collapse="\n"), ... ) - close(get(".sinkplot.conn", envir=globalenv())) + close(get(".sinkplot.conn", envir=sinkplotEnv)) - if(exists(".sinkplot.data", envir=globalenv())) - rm(".sinkplot.data", pos=globalenv()) + if(exists(".sinkplot.data", envir=sinkplotEnv, inherits=FALSE)) + rm(list=".sinkplot.data", pos=sinkplotEnv, inherits=FALSE) - if(exists(".sinkplot.conn", envir=globalenv())) - rm(".sinkplot.conn", pos=globalenv()) + if(exists(".sinkplot.conn", envir=sinkplotEnv, inherits=FALSE)) + rm(list=".sinkplot.conn", pos=sinkplotEnv, inherits=FALSE) invisible(data) } Modified: trunk/gplots/man/sinkplot.Rd =================================================================== --- trunk/gplots/man/sinkplot.Rd 2013-06-14 20:58:06 UTC (rev 1672) +++ trunk/gplots/man/sinkplot.Rd 2013-06-27 20:20:46 UTC (rev 1673) @@ -35,18 +35,18 @@ \author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link[utils]{capture.output}}, \code{\link{textplot}} } \examples{ -\dontrun{ set.seed(12456) x <- factor(sample( LETTERS[1:5], 50, replace=TRUE)) y <- rnorm(50, mean=as.numeric(x), sd=1) + ## construct a figure showing a box plot of the data, followed by an + ## analysis of variance table for the data + layout(cbind(1:2), heights=c(2,1)) - par(mfrow=c(1,2)) boxplot(y~x, col="darkgreen") sinkplot() anova(lm(y~x)) sinkplot("plot",col="darkgreen") } -} \keyword{hplot} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-06-14 20:58:08
|
Revision: 1672 http://sourceforge.net/p/r-gregmisc/code/1672 Author: warnes Date: 2013-06-14 20:58:06 +0000 (Fri, 14 Jun 2013) Log Message: ----------- Update .save files for 1.3.5 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/testDuplicateNames.Rout.save trunk/SASxport/tests/testEmpty.Rout.save trunk/SASxport/tests/testManyNames.Rout.save trunk/SASxport/tests/testNegative.Rout.save trunk/SASxport/tests/testNumeric.Rout.save trunk/SASxport/tests/testUnnamedComponents.Rout.save trunk/SASxport/tests/test_as_is.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 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -20,7 +20,7 @@ > > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -47,4 +47,4 @@ > > proc.time() user system elapsed - 0.952 0.076 1.020 + 0.956 0.092 1.147 Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/Theoph.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -22,7 +22,7 @@ > > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -43,4 +43,4 @@ > > proc.time() user system elapsed - 1.660 0.088 1.787 + 1.740 0.136 2.578 Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/cars.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -64,4 +64,4 @@ > > proc.time() user system elapsed - 0.972 0.084 1.061 + 1.016 0.092 1.399 Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/testDates.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -62,4 +62,4 @@ > > proc.time() user system elapsed - 1.132 0.096 1.244 + 1.176 0.080 1.532 Modified: trunk/SASxport/tests/testDuplicateNames.Rout.save =================================================================== --- trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -155,4 +155,4 @@ > > proc.time() user system elapsed - 1.300 0.144 2.626 + 1.392 0.152 3.531 Modified: trunk/SASxport/tests/testEmpty.Rout.save =================================================================== --- trunk/SASxport/tests/testEmpty.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/testEmpty.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -70,4 +70,4 @@ > > proc.time() user system elapsed - 1.296 0.088 1.466 + 1.344 0.120 1.715 Modified: trunk/SASxport/tests/testManyNames.Rout.save =================================================================== --- trunk/SASxport/tests/testManyNames.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/testManyNames.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -95,4 +95,4 @@ > > proc.time() user system elapsed - 19.108 0.212 19.530 + 19.368 0.216 20.394 Modified: trunk/SASxport/tests/testNegative.Rout.save =================================================================== --- trunk/SASxport/tests/testNegative.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/testNegative.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -48,4 +48,4 @@ > > proc.time() user system elapsed - 1.224 0.112 1.334 + 1.312 0.044 1.360 Modified: trunk/SASxport/tests/testNumeric.Rout.save =================================================================== --- trunk/SASxport/tests/testNumeric.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/testNumeric.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -87,4 +87,4 @@ > > proc.time() user system elapsed - 1.548 0.080 1.621 + 1.572 0.104 1.713 Modified: trunk/SASxport/tests/testUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -2163,4 +2163,4 @@ > > proc.time() user system elapsed - 5.896 1.676 12.756 + 6.192 1.760 17.901 Modified: trunk/SASxport/tests/test_as_is.Rout.save =================================================================== --- trunk/SASxport/tests/test_as_is.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/test_as_is.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -71,4 +71,4 @@ > > proc.time() user system elapsed - 0.868 0.092 0.946 + 0.884 0.076 0.963 Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/test_fields.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -32,4 +32,4 @@ > > proc.time() user system elapsed - 0.716 0.092 0.833 + 0.756 0.048 0.824 Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/xport.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -106,4 +106,4 @@ > q() > proc.time() user system elapsed - 0.888 0.132 1.031 + 0.904 0.100 1.013 Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2013-06-14 16:26:02 UTC (rev 1671) +++ trunk/SASxport/tests/xxx.Rout.save 2013-06-14 20:58:06 UTC (rev 1672) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.4 (2013-05-31). +Loaded SASxport version 1.3.5 (2013-06-14). Type `?SASxport' for usage information. @@ -79,4 +79,4 @@ > > proc.time() user system elapsed - 0.896 0.096 0.983 + 0.912 0.112 1.021 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-06-14 16:26:06
|
Revision: 1671 http://sourceforge.net/p/r-gregmisc/code/1671 Author: warnes Date: 2013-06-14 16:26:02 +0000 (Fri, 14 Jun 2013) Log Message: ----------- Updates for SASxport 1.3.5 Modified Paths: -------------- trunk/SASxport/DESCRIPTION trunk/SASxport/inst/NEWS Modified: trunk/SASxport/DESCRIPTION =================================================================== --- trunk/SASxport/DESCRIPTION 2013-06-14 16:22:39 UTC (rev 1670) +++ trunk/SASxport/DESCRIPTION 2013-06-14 16:26:02 UTC (rev 1671) @@ -1,8 +1,8 @@ Package: SASxport Type: Package Title: Read and Write SAS XPORT Files -Version: 1.3.4 -Date: 2013-05-31 +Version: 1.3.5 +Date: 2013-06-14 Description: This package provides functions for reading, listing the contents of, and writing SAS xport format files. The functions support reading and writing of either Modified: trunk/SASxport/inst/NEWS =================================================================== --- trunk/SASxport/inst/NEWS 2013-06-14 16:22:39 UTC (rev 1670) +++ trunk/SASxport/inst/NEWS 2013-06-14 16:26:02 UTC (rev 1671) @@ -1,3 +1,11 @@ +Version 1.3.5 2013-06-14 +------------------------ + +Bug fixes: + +- read.xport() and write.xport() now properly handle empty + dataset/dataframe objects. + Version 1.3.4 2013-05-31 ------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-06-14 16:22:42
|
Revision: 1670 http://sourceforge.net/p/r-gregmisc/code/1670 Author: warnes Date: 2013-06-14 16:22:39 +0000 (Fri, 14 Jun 2013) Log Message: ----------- Complete changes to handle empty datasets in xport files. Modified Paths: -------------- trunk/SASxport/R/fstr.R trunk/SASxport/R/read.xport.R trunk/SASxport/src/SASxport.c trunk/SASxport/src/writeSAS.c 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/testDuplicateNames.Rout.save trunk/SASxport/tests/testManyNames.Rout.save trunk/SASxport/tests/testNegative.Rout.save trunk/SASxport/tests/testNumeric.Rout.save trunk/SASxport/tests/testUnnamedComponents.Rout.save trunk/SASxport/tests/test_as_is.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/testEmpty.R trunk/SASxport/tests/testEmpty.Rout.save Modified: trunk/SASxport/R/fstr.R =================================================================== --- trunk/SASxport/R/fstr.R 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/R/fstr.R 2013-06-14 16:22:39 UTC (rev 1670) @@ -12,6 +12,8 @@ else return( paste(name[i], length[i], '.', digits[i], sep='' ) ) } - sapply( 1:length(name), inner) - + if(length(name)>0) + sapply( 1:length(name), inner) + else + character(0) } Modified: trunk/SASxport/R/read.xport.R =================================================================== --- trunk/SASxport/R/read.xport.R 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/R/read.xport.R 2013-06-14 16:22:39 UTC (rev 1670) @@ -121,11 +121,6 @@ scat('.') - if(!length(w)) { - scat('Empty dataset', k, 'ignored\n') - next - } - label(w) <- dsLabels[k] names(label(w)) <- NULL SAStype(w) <- dsTypes[k] @@ -145,71 +140,72 @@ ndinfo <- names.tolower(makeNames(dinfo$name, allow=name.chars)) names(lab) <- names(fmt) <- names(formats) <- names(iformats) <- ndinfo - for(i in 1:length(w)) { - changed <- FALSE - x <- w[[i]] - fi <- fmt[nam[i]]; - names(fi) <- NULL - if(fi != '' && length(finfo) && (fi %in% names(finfo))) { - f <- finfo[[fi]] - if(length(f)) { ## may be NULL because had a range in format - x <- factor(x, f$value, f$label) - attr(x, 'SASformat') <- fi - changed <- TRUE + if(length(w)>0) + for(i in 1:length(w)) { + changed <- FALSE + x <- w[[i]] + fi <- fmt[nam[i]]; + names(fi) <- NULL + if(fi != '' && length(finfo) && (fi %in% names(finfo))) { + f <- finfo[[fi]] + if(length(f)) { ## may be NULL because had a range in format + x <- factor(x, f$value, f$label) + attr(x, 'SASformat') <- fi + changed <- TRUE + } } - } - if(is.numeric(x)) { - if(fi %in% sasdateform) { - x <- importConvertDateTime(x, 'date', 'sas') - changed <- TRUE - } else if(fi %in% sastimeform) { - x <- importConvertDateTime(x, 'time', 'sas') - changed <- TRUE - } else if(fi %in% sasdatetimeform) { - x <- importConvertDateTime(x, 'datetime', 'sas') - changed <- TRUE - } else if(force.integer) { - if(all(is.na(x))) { - storage.mode(x) <- 'integer' + if(is.numeric(x)) { + if(fi %in% sasdateform) { + x <- importConvertDateTime(x, 'date', 'sas') changed <- TRUE - } else if(max(abs(x),na.rm=TRUE) <= (2^31-1) && - all(floor(x) == x, na.rm=TRUE)) { - storage.mode(x) <- 'integer' + } else if(fi %in% sastimeform) { + x <- importConvertDateTime(x, 'time', 'sas') changed <- TRUE + } else if(fi %in% sasdatetimeform) { + x <- importConvertDateTime(x, 'datetime', 'sas') + changed <- TRUE + } else if(force.integer) { + if(all(is.na(x))) { + storage.mode(x) <- 'integer' + changed <- TRUE + } else if(max(abs(x),na.rm=TRUE) <= (2^31-1) && + all(floor(x) == x, na.rm=TRUE)) { + storage.mode(x) <- 'integer' + changed <- TRUE } + } + } else if(possiblyConvertChar && is.character(x)) { + if((is.logical(as.is) && !as.is) || + (is.numeric(as.is) && length(unique(x)) < as.is*length(x))) { + x <- factor(x, exclude='') + changed <- TRUE + } } - } else if(possiblyConvertChar && is.character(x)) { - if((is.logical(as.is) && !as.is) || - (is.numeric(as.is) && length(unique(x)) < as.is*length(x))) { - x <- factor(x, exclude='') - changed <- TRUE + + lz <- lab[nam[i]] + if(!is.null(lz) && length(lz)>0 && !is.na(lz) && lz != '') { + names(lz) <- NULL + label(x) <- lz + changed <- TRUE } - } - lz <- lab[nam[i]] - if(!is.null(lz) && length(lz)>0 && !is.na(lz) && lz != '') { - names(lz) <- NULL - label(x) <- lz - changed <- TRUE + if(nam[i] %in% names(formats) && formats[nam[i]] > "" ) + { + SASformat(x) <- formats[[nam[i]]] + changed <- TRUE + } + + if(nam[i] %in% names(iformats) && iformats[nam[i]] > "" ) + { + SASformat(x) <- formats[[nam[i]]] + changed <- TRUE + } + + if(changed) + w[[i]] <- x } - if( formats[nam[i]] > "" ) - { - SASformat(x) <- formats[[nam[i]]] - changed <- TRUE - } - - if( iformats[nam[i]] > "" ) - { - SASformat(x) <- formats[[nam[i]]] - changed <- TRUE - } - - if(changed) - w[[i]] <- x - } - scat('.') res[[j]] <- w @@ -226,9 +222,11 @@ res$FORMATS <- empty.format.table() } - if(nds > 1 || as.list) res else + if(class(w)=="list") + w[[1]] + else w } Modified: trunk/SASxport/src/SASxport.c =================================================================== --- trunk/SASxport/src/SASxport.c 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/src/SASxport.c 2013-06-14 16:22:39 UTC (rev 1670) @@ -4,6 +4,7 @@ * * Copyright 1999-1999 Douglas M. Bates <ba...@st...>, * Saikat DebRoy <sa...@st...> + * Additions copyright 2007-2013 Gregory R. Warnes <gr...@wa...> * * * This program is free software; you can redistribute it and/or modify Modified: trunk/SASxport/src/writeSAS.c =================================================================== --- trunk/SASxport/src/writeSAS.c 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/src/writeSAS.c 2013-06-14 16:22:39 UTC (rev 1670) @@ -4,7 +4,7 @@ * * Author: Gregory R. Warnes <gr...@wa...> * - * Copyright (C) 2007 Gregory R. Warnes <gr...@wa...> + * Copyright (C) 2007-2013 Gregory R. Warnes <gr...@wa...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/SASxport/tests/Alfalfa_Test.Rout.save =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -47,4 +47,4 @@ > > proc.time() user system elapsed - 0.908 0.084 0.981 + 0.952 0.076 1.020 Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/Theoph.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -43,4 +43,4 @@ > > proc.time() user system elapsed - 1.632 0.092 1.811 + 1.660 0.088 1.787 Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/cars.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -64,4 +64,4 @@ > > proc.time() user system elapsed - 0.920 0.128 1.036 + 0.972 0.084 1.061 Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/testDates.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -62,4 +62,4 @@ > > proc.time() user system elapsed - 1.092 0.108 1.187 + 1.132 0.096 1.244 Modified: trunk/SASxport/tests/testDuplicateNames.Rout.save =================================================================== --- trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -155,4 +155,4 @@ > > proc.time() user system elapsed - 1.348 0.104 2.636 + 1.300 0.144 2.626 Added: trunk/SASxport/tests/testEmpty.R =================================================================== --- trunk/SASxport/tests/testEmpty.R (rev 0) +++ trunk/SASxport/tests/testEmpty.R 2013-06-14 16:22:39 UTC (rev 1670) @@ -0,0 +1,16 @@ +library(SASxport) + +data(iris) +write.xport(Iris1=iris[1:2,], + empty=data.frame(), + Iris2=iris[3:4,], + file="testEmpty.xpt") + +empty.s <- lookup.xport(file="testEmpty.xpt") +names(empty.s) +stopifnot( length(names(empty.s)) == 4 ) + +dat <- read.xport(file="testEmpty.xpt", verbose=TRUE) +stopifnot( length(names(dat)) == 3 ) +stopifnot( nrow(dat)!=0 ) +dat Added: trunk/SASxport/tests/testEmpty.Rout.save =================================================================== --- trunk/SASxport/tests/testEmpty.Rout.save (rev 0) +++ trunk/SASxport/tests/testEmpty.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -0,0 +1,73 @@ + +R version 3.0.1 (2013-05-16) -- "Good Sport" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) + +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) + +Loaded SASxport version 1.3.4 (2013-05-31). + + Type `?SASxport' for usage information. + +> +> data(iris) +> write.xport(Iris1=iris[1:2,], ++ empty=data.frame(), ++ Iris2=iris[3:4,], ++ file="testEmpty.xpt") +Warning messages: +1: In makeSASNames(colnames(df)) : Truncated 4 long names to 8 characters. +2: In makeSASNames(colnames(df)) : Truncated 4 long names to 8 characters. +> +> empty.s <- lookup.xport(file="testEmpty.xpt") +> names(empty.s) +[1] "IRIS1" "EMPTY" "IRIS2" "FORMATS" +> stopifnot( length(names(empty.s)) == 4 ) +> +> dat <- read.xport(file="testEmpty.xpt", verbose=TRUE) +### Checking if the specified file has the appropriate header ### +### Extracting data file information... ### +### Reading the data file... ### +### Processing contents... ### +### Processing SAS dataset IRIS1 ### +### . ### +### . ### +### Processing SAS dataset EMPTY ### +### . ### +### . ### +### Processing SAS dataset IRIS2 ### +### . ### +### . ### +### Done ### +> stopifnot( length(names(dat)) == 3 ) +> stopifnot( nrow(dat)!=0 ) +> dat +$iris1 + SEPAL.LE SEPAL.WI PETAL.LE PETAL.WI SPECIES +1 5.1 3.5 1.4 0.2 setosa +2 4.9 3.0 1.4 0.2 setosa + +$empty +data frame with 0 columns and 0 rows + +$iris2 + SEPAL.LE SEPAL.WI PETAL.LE PETAL.WI SPECIES +1 4.7 3.2 1.3 0.2 setosa +2 4.6 3.1 1.5 0.2 setosa + +> +> proc.time() + user system elapsed + 1.296 0.088 1.466 Modified: trunk/SASxport/tests/testManyNames.Rout.save =================================================================== --- trunk/SASxport/tests/testManyNames.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/testManyNames.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -95,4 +95,4 @@ > > proc.time() user system elapsed - 19.180 0.228 20.097 + 19.108 0.212 19.530 Modified: trunk/SASxport/tests/testNegative.Rout.save =================================================================== --- trunk/SASxport/tests/testNegative.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/testNegative.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -48,4 +48,4 @@ > > proc.time() user system elapsed - 1.292 0.116 1.475 + 1.224 0.112 1.334 Modified: trunk/SASxport/tests/testNumeric.Rout.save =================================================================== --- trunk/SASxport/tests/testNumeric.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/testNumeric.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -87,4 +87,4 @@ > > proc.time() user system elapsed - 1.604 0.180 1.846 + 1.548 0.080 1.621 Modified: trunk/SASxport/tests/testUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -2163,4 +2163,4 @@ > > proc.time() user system elapsed - 5.872 1.744 12.296 + 5.896 1.676 12.756 Modified: trunk/SASxport/tests/test_as_is.Rout.save =================================================================== --- trunk/SASxport/tests/test_as_is.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/test_as_is.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -71,4 +71,4 @@ > > proc.time() user system elapsed - 0.828 0.124 0.942 + 0.868 0.092 0.946 Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/test_fields.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -32,4 +32,4 @@ > > proc.time() user system elapsed - 0.724 0.092 0.808 + 0.716 0.092 0.833 Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/xport.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -106,4 +106,4 @@ > q() > proc.time() user system elapsed - 0.892 0.128 1.026 + 0.888 0.132 1.031 Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2013-06-14 15:13:47 UTC (rev 1669) +++ trunk/SASxport/tests/xxx.Rout.save 2013-06-14 16:22:39 UTC (rev 1670) @@ -79,4 +79,4 @@ > > proc.time() user system elapsed - 0.872 0.124 0.982 + 0.896 0.096 0.983 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-06-14 15:13:50
|
Revision: 1669 http://sourceforge.net/p/r-gregmisc/code/1669 Author: warnes Date: 2013-06-14 15:13:47 +0000 (Fri, 14 Jun 2013) Log Message: ----------- Properly handle empty datasets Modified Paths: -------------- trunk/SASxport/R/write.xport.R Modified: trunk/SASxport/R/write.xport.R =================================================================== --- trunk/SASxport/R/write.xport.R 2013-06-14 03:10:06 UTC (rev 1668) +++ trunk/SASxport/R/write.xport.R 2013-06-14 15:13:47 UTC (rev 1669) @@ -152,7 +152,9 @@ colnames(dfList[[i]]) <- colnames(df) <- varNames <- makeSASNames(colnames(df)) - offsetTable <- data.frame("name"=varNames, "len"=NA, "offset"=NA ) + offsetTable <- data.frame("name"=varNames, + "len"=rep(NA, length(varNames)), + "offset"=rep(NA, length(varNames)) ) rownames(offsetTable) <- offsetTable[,"name"] dfLabel <- label(df, default="" ) @@ -239,22 +241,25 @@ scat("Write data ... "); spaceUsed <- 0 - for(i in 1:nrow(df) ) - for(j in 1:ncol(df) ) + if(nrow(df)>0) { - val <- df[i,j] - valLen <- offsetTable[j,"len"] + for(i in 1:nrow(df) ) + for(j in 1:ncol(df) ) + { + val <- df[i,j] + valLen <- offsetTable[j,"len"] + + scat("i=", i, " j=", j, " value=", val, " len=", valLen, ""); + if(is.character( val )) + { + out(xport.character(val, width=valLen ) ) + } + else + out( xport.numeric( val ) ) - scat("i=", i, " j=", j, " value=", val, " len=", valLen, ""); - if(is.character( val )) - { - out(xport.character(val, width=valLen ) ) + spaceUsed <- spaceUsed + valLen } - else - out( xport.numeric( val ) ) - - spaceUsed <- spaceUsed + valLen - } + } fillSize <- 80 - (spaceUsed %% 80) if(fillSize==80) fillSize <- 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-06-14 03:10:12
|
Revision: 1668 http://sourceforge.net/p/r-gregmisc/code/1668 Author: warnes Date: 2013-06-14 03:10:06 +0000 (Fri, 14 Jun 2013) Log Message: ----------- Fix bug when xpt file contains an empty data set Modified Paths: -------------- trunk/SASxport/R/lookup.xport.R trunk/SASxport/src/SASxport.c Modified: trunk/SASxport/R/lookup.xport.R =================================================================== --- trunk/SASxport/R/lookup.xport.R 2013-05-31 23:18:03 UTC (rev 1667) +++ trunk/SASxport/R/lookup.xport.R 2013-06-14 03:10:06 UTC (rev 1668) @@ -37,6 +37,7 @@ "label" ) ]) + if(nrow(ret)==0) ret[1,] <- NA # ensure at least one row cbind(dataset=XX, ret, nobs=df$length) } Modified: trunk/SASxport/src/SASxport.c =================================================================== --- trunk/SASxport/src/SASxport.c 2013-05-31 23:18:03 UTC (rev 1667) +++ trunk/SASxport/src/SASxport.c 2013-06-14 03:10:06 UTC (rev 1668) @@ -587,7 +587,9 @@ PROTECT(ans = allocVector(VECSXP, 0)); PROTECT(ansNames = allocVector(STRSXP, 0)); - while(namestrLength > 0 && (memLength = init_mem_info(fp, dsname, dslabel, dstype)) > 0) { + while(!feof(fp)) + { + memLength = init_mem_info(fp, dsname, dslabel, dstype); PROTECT(varInfo = allocVector(VECSXP, VAR_INFO_LENGTH)); setAttrib(varInfo, R_NamesSymbol, varInfoNames); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-31 23:18:05
|
Revision: 1667 http://sourceforge.net/p/r-gregmisc/code/1667 Author: warnes Date: 2013-05-31 23:18:03 +0000 (Fri, 31 May 2013) Log Message: ----------- Update test Rout.save files to match new version 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/testDuplicateNames.Rout.save trunk/SASxport/tests/testManyNames.Rout.save trunk/SASxport/tests/testNegative.Rout.save trunk/SASxport/tests/testNumeric.Rout.save trunk/SASxport/tests/testUnnamedComponents.Rout.save trunk/SASxport/tests/test_as_is.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 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -20,7 +20,7 @@ > > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -47,4 +47,4 @@ > > proc.time() user system elapsed - 0.936 0.088 1.015 + 0.908 0.084 0.981 Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/Theoph.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -22,7 +22,7 @@ > > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -43,4 +43,4 @@ > > proc.time() user system elapsed - 1.668 0.080 1.773 + 1.632 0.092 1.811 Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/cars.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -64,4 +64,4 @@ > > proc.time() user system elapsed - 0.976 0.084 1.064 + 0.920 0.128 1.036 Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/testDates.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -62,4 +62,4 @@ > > proc.time() user system elapsed - 1.128 0.084 1.201 + 1.092 0.108 1.187 Modified: trunk/SASxport/tests/testDuplicateNames.Rout.save =================================================================== --- trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -155,4 +155,4 @@ > > proc.time() user system elapsed - 1.368 0.100 2.671 + 1.348 0.104 2.636 Modified: trunk/SASxport/tests/testManyNames.Rout.save =================================================================== --- trunk/SASxport/tests/testManyNames.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/testManyNames.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -95,4 +95,4 @@ > > proc.time() user system elapsed - 19.312 0.284 19.745 + 19.180 0.228 20.097 Modified: trunk/SASxport/tests/testNegative.Rout.save =================================================================== --- trunk/SASxport/tests/testNegative.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/testNegative.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -48,4 +48,4 @@ > > proc.time() user system elapsed - 1.272 0.064 1.324 + 1.292 0.116 1.475 Modified: trunk/SASxport/tests/testNumeric.Rout.save =================================================================== --- trunk/SASxport/tests/testNumeric.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/testNumeric.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -87,4 +87,4 @@ > > proc.time() user system elapsed - 1.572 0.084 1.651 + 1.604 0.180 1.846 Modified: trunk/SASxport/tests/testUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -2163,4 +2163,4 @@ > > proc.time() user system elapsed - 6.016 1.632 12.803 + 5.872 1.744 12.296 Modified: trunk/SASxport/tests/test_as_is.Rout.save =================================================================== --- trunk/SASxport/tests/test_as_is.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/test_as_is.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -71,4 +71,4 @@ > > proc.time() user system elapsed - 0.876 0.092 0.973 + 0.828 0.124 0.942 Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/test_fields.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -32,4 +32,4 @@ > > proc.time() user system elapsed - 0.756 0.060 0.835 + 0.724 0.092 0.808 Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/xport.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -106,4 +106,4 @@ > q() > proc.time() user system elapsed - 0.888 0.124 1.018 + 0.892 0.128 1.026 Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2013-05-31 17:26:09 UTC (rev 1666) +++ trunk/SASxport/tests/xxx.Rout.save 2013-05-31 23:18:03 UTC (rev 1667) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-30). +Loaded SASxport version 1.3.4 (2013-05-31). Type `?SASxport' for usage information. @@ -79,4 +79,4 @@ > > proc.time() user system elapsed - 0.900 0.104 1.013 + 0.872 0.124 0.982 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-31 17:26:14
|
Revision: 1666 http://sourceforge.net/p/r-gregmisc/code/1666 Author: warnes Date: 2013-05-31 17:26:09 +0000 (Fri, 31 May 2013) Log Message: ----------- Update for SASxport 1.3.4 Modified Paths: -------------- trunk/SASxport/DESCRIPTION trunk/SASxport/inst/NEWS Modified: trunk/SASxport/DESCRIPTION =================================================================== --- trunk/SASxport/DESCRIPTION 2013-05-31 03:53:49 UTC (rev 1665) +++ trunk/SASxport/DESCRIPTION 2013-05-31 17:26:09 UTC (rev 1666) @@ -1,8 +1,8 @@ Package: SASxport Type: Package Title: Read and Write SAS XPORT Files -Version: 1.3.3 -Date: 2013-05-30 +Version: 1.3.4 +Date: 2013-05-31 Description: This package provides functions for reading, listing the contents of, and writing SAS xport format files. The functions support reading and writing of either Modified: trunk/SASxport/inst/NEWS =================================================================== --- trunk/SASxport/inst/NEWS 2013-05-31 03:53:49 UTC (rev 1665) +++ trunk/SASxport/inst/NEWS 2013-05-31 17:26:09 UTC (rev 1666) @@ -1,10 +1,14 @@ -Version 1.3.3 2013-05-30 +Version 1.3.4 2013-05-31 ------------------------ Bug fixes: - Correct error in write.xport when a factor contains only NA entries. +Other Changes: + +- Package test scripts now use a fixed timezone to prevent unhelpful warnings. + Version 1.3.2 2013-05-11 ------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-31 03:53:52
|
Revision: 1665 http://sourceforge.net/p/r-gregmisc/code/1665 Author: warnes Date: 2013-05-31 03:53:49 +0000 (Fri, 31 May 2013) Log Message: ----------- Explicitly specify timezone in tests/*.R to avoid extraneous warnings Modified Paths: -------------- trunk/SASxport/tests/Alfalfa_Test.R trunk/SASxport/tests/Alfalfa_Test.Rout.save trunk/SASxport/tests/Theoph.R trunk/SASxport/tests/Theoph.Rout.save trunk/SASxport/tests/cars.R trunk/SASxport/tests/cars.Rout.save trunk/SASxport/tests/dfAttributes.R trunk/SASxport/tests/testBlockBoundary.R trunk/SASxport/tests/testDates.R trunk/SASxport/tests/testDates.Rout.save trunk/SASxport/tests/testDuplicateNames.R trunk/SASxport/tests/testDuplicateNames.Rout.save trunk/SASxport/tests/testFactorAllNA.R trunk/SASxport/tests/testManyNames.R trunk/SASxport/tests/testManyNames.Rout.save trunk/SASxport/tests/testNegative.R trunk/SASxport/tests/testNegative.Rout.save trunk/SASxport/tests/testNumeric.R trunk/SASxport/tests/testNumeric.Rout.save trunk/SASxport/tests/testUnnamedComponents.R trunk/SASxport/tests/testUnnamedComponents.Rout.save trunk/SASxport/tests/test_as_is.R trunk/SASxport/tests/test_as_is.Rout.save trunk/SASxport/tests/test_fields.R trunk/SASxport/tests/test_fields.Rout.save trunk/SASxport/tests/xport.R trunk/SASxport/tests/xport.Rout.save trunk/SASxport/tests/xxx.R trunk/SASxport/tests/xxx.Rout.save Modified: trunk/SASxport/tests/Alfalfa_Test.R =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/Alfalfa_Test.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -2,6 +2,7 @@ ## existing SAS xport file "Alfalfa.xpt" library(SASxport) +Sys.setenv("TZ"="GMT") # existing data file SPEC <- read.xport("Alfalfa.xpt") Modified: trunk/SASxport/tests/Alfalfa_Test.Rout.save =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -24,6 +24,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > # existing data file > SPEC <- read.xport("Alfalfa.xpt") @@ -46,4 +47,4 @@ > > proc.time() user system elapsed - 0.940 0.052 0.985 + 0.936 0.088 1.015 Modified: trunk/SASxport/tests/Theoph.R =================================================================== --- trunk/SASxport/tests/Theoph.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/Theoph.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -4,6 +4,7 @@ #### library(SASxport) +Sys.setenv("TZ"="GMT") write.xport(Theoph,file="theoph.xpt") Theoph.2 <- read.xport("theoph.xpt") Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/Theoph.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -26,6 +26,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > write.xport(Theoph,file="theoph.xpt") > Theoph.2 <- read.xport("theoph.xpt") @@ -42,4 +43,4 @@ > > proc.time() user system elapsed - 1.632 0.084 1.705 + 1.668 0.080 1.773 Modified: trunk/SASxport/tests/cars.R =================================================================== --- trunk/SASxport/tests/cars.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/cars.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") cars <- read.table(file="cars.sas", skip=3, nrows=26, Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/cars.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,6 +21,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > > cars <- read.table(file="cars.sas", skip=3, nrows=26, @@ -63,4 +64,4 @@ > > proc.time() user system elapsed - 0.904 0.096 0.998 + 0.976 0.084 1.064 Modified: trunk/SASxport/tests/dfAttributes.R =================================================================== --- trunk/SASxport/tests/dfAttributes.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/dfAttributes.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") ## manually create a data set abc.out <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) Modified: trunk/SASxport/tests/testBlockBoundary.R =================================================================== --- trunk/SASxport/tests/testBlockBoundary.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testBlockBoundary.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -3,6 +3,8 @@ ## loading the created data file. library(SASxport) +Sys.setenv("TZ"="GMT") + events <- read.csv('events.csv') exposure <- read.csv('exposure.csv') events Modified: trunk/SASxport/tests/testDates.R =================================================================== --- trunk/SASxport/tests/testDates.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testDates.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") ## Create a small data set containing dates, times, and date-times Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testDates.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,6 +21,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > ## Create a small data set containing dates, times, and date-times > @@ -61,4 +62,4 @@ > > proc.time() user system elapsed - 1.112 0.084 1.183 + 1.128 0.084 1.201 Modified: trunk/SASxport/tests/testDuplicateNames.R =================================================================== --- trunk/SASxport/tests/testDuplicateNames.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testDuplicateNames.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,6 +1,6 @@ library(SASxport) +Sys.setenv("TZ"="GMT") - ##tests example(read.xport) Modified: trunk/SASxport/tests/testDuplicateNames.Rout.save =================================================================== --- trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,8 +21,8 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > -> > ##tests > example(read.xport) @@ -119,23 +119,23 @@ > read.xport("dn.a.xpt") $aa RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $aa.1 RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $aa.2 RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $aa.3 RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 > > # Duplicate column names @@ -147,12 +147,12 @@ In makeSASNames(colnames(df)) : Made 5 duplicate names unique. > read.xport("dn.b.xpt") RACE AGE D1 DT1 T1 RACE.1 AGE.1 D1.1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 blue 30 2002-03-03 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 31 2002-06-03 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 blue 30 2002-03-03 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 31 2002-06-03 DT1.1 T1.1 -1 (03 Mar 2002 04:31:02) 11:13:45 -2 (03 Jun 2002 04:42:07) 11:14:13 +1 (03 Mar 2002 09:31:02) 11:13:45 +2 (03 Jun 2002 09:42:07) 11:14:13 > > proc.time() user system elapsed - 1.292 0.124 2.566 + 1.368 0.100 2.671 Modified: trunk/SASxport/tests/testFactorAllNA.R =================================================================== --- trunk/SASxport/tests/testFactorAllNA.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testFactorAllNA.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") x <- data.frame(A=1:10, B=letters[1:10], Modified: trunk/SASxport/tests/testManyNames.R =================================================================== --- trunk/SASxport/tests/testManyNames.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testManyNames.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") data(iris) Modified: trunk/SASxport/tests/testManyNames.Rout.save =================================================================== --- trunk/SASxport/tests/testManyNames.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testManyNames.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,6 +21,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > data(iris) > @@ -94,4 +95,4 @@ > > proc.time() user system elapsed - 19.392 0.172 19.717 + 19.312 0.284 19.745 Modified: trunk/SASxport/tests/testNegative.R =================================================================== --- trunk/SASxport/tests/testNegative.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testNegative.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") df1 <- data.frame( f=c(1.0, -1.0), d=as.integer(c(-1,1) ) ) write.xport(df1, file='df1.xpt') Modified: trunk/SASxport/tests/testNegative.Rout.save =================================================================== --- trunk/SASxport/tests/testNegative.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testNegative.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,6 +21,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > df1 <- data.frame( f=c(1.0, -1.0), d=as.integer(c(-1,1) ) ) > write.xport(df1, file='df1.xpt') @@ -47,4 +48,4 @@ > > proc.time() user system elapsed - 1.260 0.072 1.321 + 1.272 0.064 1.324 Modified: trunk/SASxport/tests/testNumeric.R =================================================================== --- trunk/SASxport/tests/testNumeric.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testNumeric.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") ## ## Construct a data frame with all common R data types. Modified: trunk/SASxport/tests/testNumeric.Rout.save =================================================================== --- trunk/SASxport/tests/testNumeric.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testNumeric.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,6 +21,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > ## > ## Construct a data frame with all common R data types. @@ -86,4 +87,4 @@ > > proc.time() user system elapsed - 1.584 0.096 1.673 + 1.572 0.084 1.651 Modified: trunk/SASxport/tests/testUnnamedComponents.R =================================================================== --- trunk/SASxport/tests/testUnnamedComponents.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testUnnamedComponents.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,6 +1,6 @@ library(SASxport) +Sys.setenv("TZ"="GMT") - ##tests example(read.xport) write.xport(w$test,file="a.xpt") #1.a Modified: trunk/SASxport/tests/testUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,8 +21,8 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > -> > ##tests > example(read.xport) @@ -134,8 +134,8 @@ > (tmp <- read.xport("a.xpt")) #1.c RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 > > b <- w$test > write.xport(b,file="a.xpt") #2.a @@ -161,8 +161,8 @@ > (tmp <- read.xport("a.xpt")) #2.c RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 > > write.xport(test=w$test,file="a.xpt") #3.a > lookup.xport("a.xpt") #3.b @@ -187,8 +187,8 @@ > (tmp <- read.xport("a.xpt")) #3.c RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 > > write.xport(test=w$test,z=w$z,file="a.xpt") #4.a > lookup.xport("a.xpt") #4.b @@ -230,8 +230,8 @@ > (tmp <- read.xport("a.xpt")) #4.c $test RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $z X3 X4 X5 X6 X7 X8 @@ -377,8 +377,8 @@ > (tmp <- read.xport("a.xpt")) #5.c $`w$test` RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $`w$z` X3 X4 X5 X6 X7 X8 @@ -524,8 +524,8 @@ > (tmp <- read.xport("a.xpt")) #6.c $`w$test` RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $z X3 X4 X5 X6 X7 X8 @@ -717,8 +717,8 @@ > (tmp <- read.xport("a.xpt")) #7.c $test RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 <NA> 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 <NA> 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $z X3 X4 X5 X6 X7 X8 @@ -865,8 +865,8 @@ > (tmp <- read.xport("a.xpt")) #8.c $`w[[1]]` RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $`w[[2]]` X3 X4 X5 X6 X7 X8 @@ -1062,8 +1062,8 @@ > (tmp <- read.xport("a.xpt")) #9.c $data1 RACE AGE D1 DT1 T1 -1 <NA> 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 <NA> 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 <NA> 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 <NA> 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $data2 X3 X4 X5 X6 X7 X8 @@ -1177,8 +1177,8 @@ > (tmp <- read.xport("a.xpt")) #10.c $data1 RACE AGE D1 DT1 T1 -1 <NA> 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 <NA> 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 <NA> 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 <NA> 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $data2 X3 X4 X5 X6 X7 X8 @@ -1291,8 +1291,8 @@ > (tmp <- read.xport("a.xpt")) #10.c $data1 RACE AGE D1 DT1 T1 -1 <NA> 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 <NA> 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 <NA> 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 <NA> 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $data2 X3 X4 X5 X6 X7 X8 @@ -1529,8 +1529,8 @@ > (tmp <- read.xport("a.xpt")) #11.c $data1 RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $data2 X3 X4 X5 X6 X7 X8 @@ -1769,8 +1769,8 @@ > (tmp <- read.xport("a.xpt")) #12.c $data1 RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $data2 X3 X4 X5 X6 X7 X8 @@ -2054,8 +2054,8 @@ > (tmp <- read.xport("a.xpt")) #13.c $test RACE AGE D1 DT1 T1 -1 blue 30 2002-03-03 (03 Mar 2002 04:31:02) 11:13:45 -2 <NA> 31 2002-06-03 (03 Jun 2002 04:42:07) 11:14:13 +1 blue 30 2002-03-03 (03 Mar 2002 09:31:02) 11:13:45 +2 <NA> 31 2002-06-03 (03 Jun 2002 09:42:07) 11:14:13 $z VAR1 VAR2 VAR3 VAR4 VAR5 VAR6 @@ -2163,4 +2163,4 @@ > > proc.time() user system elapsed - 6.024 1.684 14.087 + 6.016 1.632 12.803 Modified: trunk/SASxport/tests/test_as_is.R =================================================================== --- trunk/SASxport/tests/test_as_is.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/test_as_is.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") lookup.xport('puromycin.xpt') Modified: trunk/SASxport/tests/test_as_is.Rout.save =================================================================== --- trunk/SASxport/tests/test_as_is.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/test_as_is.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,6 +21,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > lookup.xport('puromycin.xpt') @@ -70,4 +71,4 @@ > > proc.time() user system elapsed - 0.860 0.112 0.996 + 0.876 0.092 0.973 Modified: trunk/SASxport/tests/test_fields.R =================================================================== --- trunk/SASxport/tests/test_fields.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/test_fields.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") ## Call C-level test routines Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/test_fields.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,6 +21,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > ## Call C-level test routines > @@ -31,4 +32,4 @@ > > proc.time() user system elapsed - 0.756 0.056 0.820 + 0.756 0.060 0.835 Modified: trunk/SASxport/tests/xport.R =================================================================== --- trunk/SASxport/tests/xport.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/xport.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") lookup.xport("Alfalfa.xpt") Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/xport.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,6 +21,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > lookup.xport("Alfalfa.xpt") @@ -105,4 +106,4 @@ > q() > proc.time() user system elapsed - 0.908 0.108 1.018 + 0.888 0.124 1.018 Modified: trunk/SASxport/tests/xxx.R =================================================================== --- trunk/SASxport/tests/xxx.R 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/xxx.R 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,4 +1,5 @@ library(SASxport) +Sys.setenv("TZ"="GMT") ## manually create a data set abc <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) +++ trunk/SASxport/tests/xxx.Rout.save 2013-05-31 03:53:49 UTC (rev 1665) @@ -1,5 +1,5 @@ -R version 3.0.0 (2013-04-03) -- "Masked Marvel" +R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -21,6 +21,7 @@ Type `?SASxport' for usage information. +> Sys.setenv("TZ"="GMT") > > ## manually create a data set > abc <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) @@ -78,4 +79,4 @@ > > proc.time() user system elapsed - 0.908 0.092 0.991 + 0.900 0.104 1.013 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-31 03:14:58
|
Revision: 1664 http://sourceforge.net/p/r-gregmisc/code/1664 Author: warnes Date: 2013-05-31 03:14:56 +0000 (Fri, 31 May 2013) Log Message: ----------- Update build date. 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/testDuplicateNames.Rout.save trunk/SASxport/tests/testManyNames.Rout.save trunk/SASxport/tests/testNegative.Rout.save trunk/SASxport/tests/testNumeric.Rout.save trunk/SASxport/tests/testUnnamedComponents.Rout.save trunk/SASxport/tests/test_as_is.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 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -20,7 +20,7 @@ > > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/Theoph.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -22,7 +22,7 @@ > > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/cars.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/testDates.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testDuplicateNames.Rout.save =================================================================== --- trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testManyNames.Rout.save =================================================================== --- trunk/SASxport/tests/testManyNames.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/testManyNames.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testNegative.Rout.save =================================================================== --- trunk/SASxport/tests/testNegative.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/testNegative.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testNumeric.Rout.save =================================================================== --- trunk/SASxport/tests/testNumeric.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/testNumeric.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/test_as_is.Rout.save =================================================================== --- trunk/SASxport/tests/test_as_is.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/test_as_is.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/test_fields.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/xport.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) +++ trunk/SASxport/tests/xxx.Rout.save 2013-05-31 03:14:56 UTC (rev 1664) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.3 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-30). 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...> - 2013-05-31 03:09:27
|
Revision: 1663 http://sourceforge.net/p/r-gregmisc/code/1663 Author: warnes Date: 2013-05-31 03:09:24 +0000 (Fri, 31 May 2013) Log Message: ----------- Update for SASxport 1.3.3 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/testDuplicateNames.Rout.save trunk/SASxport/tests/testManyNames.Rout.save trunk/SASxport/tests/testNegative.Rout.save trunk/SASxport/tests/testNumeric.Rout.save trunk/SASxport/tests/testUnnamedComponents.Rout.save trunk/SASxport/tests/test_as_is.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 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -20,7 +20,7 @@ > > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/Theoph.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -22,7 +22,7 @@ > > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/cars.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/testDates.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testDuplicateNames.Rout.save =================================================================== --- trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testManyNames.Rout.save =================================================================== --- trunk/SASxport/tests/testManyNames.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/testManyNames.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testNegative.Rout.save =================================================================== --- trunk/SASxport/tests/testNegative.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/testNegative.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testNumeric.Rout.save =================================================================== --- trunk/SASxport/tests/testNumeric.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/testNumeric.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/testUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/test_as_is.Rout.save =================================================================== --- trunk/SASxport/tests/test_as_is.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/test_as_is.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/test_fields.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/xport.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). Type `?SASxport' for usage information. Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2013-05-31 03:04:30 UTC (rev 1662) +++ trunk/SASxport/tests/xxx.Rout.save 2013-05-31 03:09:24 UTC (rev 1663) @@ -17,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.2 (2013-05-11). +Loaded SASxport version 1.3.3 (2013-05-11). 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...> - 2013-05-31 03:04:32
|
Revision: 1662 http://sourceforge.net/p/r-gregmisc/code/1662 Author: warnes Date: 2013-05-31 03:04:30 +0000 (Fri, 31 May 2013) Log Message: ----------- Update for SASxport 1.3.3 Modified Paths: -------------- trunk/SASxport/DESCRIPTION trunk/SASxport/inst/NEWS Modified: trunk/SASxport/DESCRIPTION =================================================================== --- trunk/SASxport/DESCRIPTION 2013-05-31 03:02:44 UTC (rev 1661) +++ trunk/SASxport/DESCRIPTION 2013-05-31 03:04:30 UTC (rev 1662) @@ -1,8 +1,8 @@ Package: SASxport Type: Package Title: Read and Write SAS XPORT Files -Version: 1.3.2 -Date: 2013-05-11 +Version: 1.3.3 +Date: 2013-05-30 Description: This package provides functions for reading, listing the contents of, and writing SAS xport format files. The functions support reading and writing of either Modified: trunk/SASxport/inst/NEWS =================================================================== --- trunk/SASxport/inst/NEWS 2013-05-31 03:02:44 UTC (rev 1661) +++ trunk/SASxport/inst/NEWS 2013-05-31 03:04:30 UTC (rev 1662) @@ -1,3 +1,10 @@ +Version 1.3.3 2013-05-30 +------------------------ + +Bug fixes: + +- Correct error in write.xport when a factor contains only NA entries. + Version 1.3.2 2013-05-11 ------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-31 03:02:46
|
Revision: 1661 http://sourceforge.net/p/r-gregmisc/code/1661 Author: warnes Date: 2013-05-31 03:02:44 +0000 (Fri, 31 May 2013) Log Message: ----------- Correct error in write.xport when a factor contains only NA entries. Modified Paths: -------------- trunk/SASxport/R/make.formats.R Added Paths: ----------- trunk/SASxport/tests/testFactorAllNA.R Modified: trunk/SASxport/R/make.formats.R =================================================================== --- trunk/SASxport/R/make.formats.R 2013-05-12 01:48:49 UTC (rev 1660) +++ trunk/SASxport/R/make.formats.R 2013-05-31 03:02:44 UTC (rev 1661) @@ -76,14 +76,16 @@ else formatName <- fname varLevels <- levels(var) - formats <- empty.format.table() - for( j in 1:nlevels(var) ) - formats <- add.format.entry(formats, - formatName, - j, - j, - varLevels[j] - ) + formats <- empty.format.table() + + if(nlevels(var)>0) + for( j in 1:nlevels(var) ) + formats <- add.format.entry(formats, + formatName, + j, + j, + varLevels[j] + ) formats } Added: trunk/SASxport/tests/testFactorAllNA.R =================================================================== --- trunk/SASxport/tests/testFactorAllNA.R (rev 0) +++ trunk/SASxport/tests/testFactorAllNA.R 2013-05-31 03:02:44 UTC (rev 1661) @@ -0,0 +1,16 @@ +library(SASxport) + +x <- data.frame(A=1:10, + B=letters[1:10], + C=factor(rep(NA,10)), + D=factor(rep(NA,10), levels=c("A","B","C")), + E=as.numeric(rep(NA,10)), + stringsAsFactors=FALSE + ) +write.xport(x,file='testFactorAllNA.out.xpt') + +y <- read.xport(file='testFactorAllNA.out.xpt') + +stopifnot( all.equal(x,y, check.attributes = FALSE) ) +stopifnot( all.equal(levels(x$C), levels(y$C) ) ) +stopifnot( all.equal(levels(x$D), levels(y$D) ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-12 01:48:53
|
Revision: 1660 http://sourceforge.net/p/r-gregmisc/code/1660 Author: warnes Date: 2013-05-12 01:48:49 +0000 (Sun, 12 May 2013) Log Message: ----------- Update NEWS for release Modified Paths: -------------- trunk/SASxport/DESCRIPTION trunk/SASxport/R/SAStype.R trunk/SASxport/R/read.xport.R trunk/SASxport/inst/NEWS trunk/SASxport/man/SASxport-package.Rd trunk/SASxport/man/label.Rd trunk/SASxport/man/read.xport.Rd trunk/SASxport/man/write.xport.Rd 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/testDuplicateNames.Rout.save trunk/SASxport/tests/testManyNames.Rout.save trunk/SASxport/tests/testNegative.Rout.save trunk/SASxport/tests/testNumeric.Rout.save trunk/SASxport/tests/testUnnamedComponents.Rout.save trunk/SASxport/tests/test_as_is.Rout.save trunk/SASxport/tests/test_fields.Rout.save trunk/SASxport/tests/xport.Rout.save trunk/SASxport/tests/xxx.Rout.save Modified: trunk/SASxport/DESCRIPTION =================================================================== --- trunk/SASxport/DESCRIPTION 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/DESCRIPTION 2013-05-12 01:48:49 UTC (rev 1660) @@ -14,19 +14,26 @@ Gregory R. Warnes <gr...@wa...> and are provided under the terms of the GNU General Public License, version 2.0 or later. -- - The files 'ieee2ibm.c' and 'ibm2ieee.c' were extracted from BRL-CAD, - file /brlcad/src/libbu/htond.c written by Michael John Muuss, - Copyright (c) 2004-2007 United States Government as represented by - the U.S. Army Research Laboratory, and is utilized and redistributed - under the terms of the GNU Lesser General Public License, version 2.1. + The files 'src/ieee2ibm.c' and 'src/ibm2ieee.c' were extracted from + BRL-CAD file /brlcad/src/libbu/htond.c written by Michael John + Muuss, Copyright (c) 2004-2007 United States Government as + represented by the U.S. Army Research Laboratory, and is utilized + and redistributed under the terms of the GNU Lesser General Public + License, version 2.1. -- - The files 'AFirst.lib.s', 'all.is.numeric.R', - 'importConvertDateTime.R', 'in.opererator.R', 'makeNames.R', - 'read.xport.R', and 'testDateTime.R' are copied or adapted from the + The files 'R/AFirst.lib.s', 'R/all.is.numeric.R', + 'R/importConvertDateTime.R', 'R/in.opererator.R', 'R/makeNames.R', + 'R/read.xport.R', and 'R/testDateTime.R' are copied or adapted from the 'Hmisc' package created by Frank E. Harrell, Jr. <f.h...@va...>, and are utilized and redistributed under the terms of the GNU General Public License, version 2.0 or later. -- + The files 'R/xport.R', 'src/SASxport.c', 'src/SASxport.h', and + 'src/foreign.h' are copied or adapted from the R 'foreign' package + created by Douglas M. Bates <ba...@st...> and Saikat DebRoy + <sa...@st...>, and are utilized and redistributed under the + terms of the GNU General Public License, version 2.0 or later. + -- The creation of this package was partially funded by Metrum Institute <http://metruminstitute.org>. Maintainer: Gregory R. Warnes <gr...@wa...> Modified: trunk/SASxport/R/SAStype.R =================================================================== --- trunk/SASxport/R/SAStype.R 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/R/SAStype.R 2013-05-12 01:48:49 UTC (rev 1660) @@ -15,6 +15,6 @@ "SAStype<-.default" <- function(x, value) { - attr(x,'SAStype') <- value + attr(x,'SAStype') <- makeSASNames(value) x } Modified: trunk/SASxport/R/read.xport.R =================================================================== --- trunk/SASxport/R/read.xport.R 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/R/read.xport.R 2013-05-12 01:48:49 UTC (rev 1660) @@ -127,7 +127,9 @@ } label(w) <- dsLabels[k] + names(label(w)) <- NULL SAStype(w) <- dsTypes[k] + names(SAStype(w)) <- NULL nam <- names.tolower(makeNames(names(w), allow=name.chars)) names(w) <- nam Modified: trunk/SASxport/inst/NEWS =================================================================== --- trunk/SASxport/inst/NEWS 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/inst/NEWS 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,6 +1,11 @@ Version 1.3.2 2013-05-11 ------------------------ +New features: + +- dataset label and type are now supported. See write.xport() and + read.xport() for examples. + Bug fixes: - Integrate patch from foreign package to properly handle xport files Modified: trunk/SASxport/man/SASxport-package.Rd =================================================================== --- trunk/SASxport/man/SASxport-package.Rd 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/man/SASxport-package.Rd 2013-05-12 01:48:49 UTC (rev 1660) @@ -12,7 +12,7 @@ \details{ The \code{read.xport} function reads SAS xport formatted files, augmenting the functionality of the \code{\link[foreign]{read.xport}} - function provided in the 'foreign' package with additional features + function provided in the 'foreign' package with additional features, borrowed from \code{\link[Hmisc]{sasxport.get}} in Frank Harrell's 'Hmisc' package. Namely, variables are properly coerced into the types specified by the format field. All standard numeric and string @@ -21,7 +21,10 @@ in the xport file via: \preformatted{ PROC FORMAT CNTLOUT=format; -} + } + In addition, labels are supported for variable and data frames, as + are dataset 'types'. + The \code{write.xport} function writes one or more data sets into a SAS xport formatted file. Standard R data types, including date and time objects (e.g. \code{Date}, and \code{POSIX.t}) are stored with @@ -57,19 +60,25 @@ are provided under the terms of the GNU General Public License, version 2.0 or later. - The file 'htond.c' is extracted from BRL-CAD - \url{http://www.brlcad.org/}, written by Michael John Muuss, and is - Copyright (c) 2004-2007 United States Government as represented by - the U.S. Army Research Laboratory, and is utilized and redistributed - under the terms of the GNU Lesser General Public License, version 2.1. + The files 'src/ieee2ibm.c' and 'src/ibm2ieee.c' were extracted from + BRL-CAD file /brlcad/src/libbu/htond.c written by Michael John Muuss, + Copyright (c) 2004-2007 United States Government as represented by the + U.S. Army Research Laboratory, and is utilized and redistributed under + the terms of the GNU Lesser General Public License, version 2.1. - The files 'AFirst.lib.s', 'all.is.numeric.R', - 'importConvertDateTime.R', 'in.opererator.R', 'makeNames.R', - 'read.xport.R', and 'testDateTime.R' are copied or adapted from the - 'Hmisc' package created by Frank E. Harrell, Jr. - \email{f.h...@va...}, and are utilized and redistributed under + The files 'R/AFirst.lib.s', 'R/all.is.numeric.R', + 'R/importConvertDateTime.R', 'R/in.opererator.R', 'R/makeNames.R', + 'R/read.xport.R', and 'R/testDateTime.R' are copied or adapted from + the 'Hmisc' package created by Frank E. Harrell, Jr. + <f.h...@va...>, and are utilized and redistributed under the terms of the GNU General Public License, version 2.0 or later. - } + + The files 'R/xport.R', 'src/SASxport.c', 'src/SASxport.h', and + 'src/foreign.h' are copied or adapted from the R 'foreign' package + created by Douglas M. Bates <ba...@st...> and Saikat DebRoy + <sa...@st...>, and are utilized and redistributed under the + terms of the GNU General Public License, version 2.0 or later. +} \section{Funding}{ This creation of this package was partially funded by Metrum Institute \url{http://metruminstitute.org}. Modified: trunk/SASxport/man/label.Rd =================================================================== --- trunk/SASxport/man/label.Rd 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/man/label.Rd 2013-05-12 01:48:49 UTC (rev 1660) @@ -30,6 +30,8 @@ More comprehensive support for object labels, and SASformat, are available in Frank Harrell's \code{Hmisc} package. + + Note that \code{SAStype} enforces the SAS 8-character naming convention. } \usage{ label(x, default) Modified: trunk/SASxport/man/read.xport.Rd =================================================================== --- trunk/SASxport/man/read.xport.Rd 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/man/read.xport.Rd 2013-05-12 01:48:49 UTC (rev 1660) @@ -82,10 +82,15 @@ \item SAS date, time, and date/time variables are converted respectively to \code{Date}, POSIX, or \code{chron} objects - \item SAS labels are stored in "label" attributes on each variable + \item SAS labels are stored in "label" attributes on each variable, + and are accessible using the \code{\link{label}} function. - \item SAS formats are stored in "format" attributes on each variable + \item SAS formats are stored in "SASformat" attributes on each + variable, and are accessable using \code{\link{SASformat}} + \item SAS iformats are stored in "SASiformat" attributes on each + variable, and are accessable using \code{\link{SASiformat}} + \item SAS integer variables are stored as integers unless \code{force.integer} is \code{FALSE} } @@ -93,6 +98,11 @@ If the file includes the output of \code{PROC FORMAT CNTLOUT=}, variables having customized label formats will be converted to \code{factor} objects with appropriate labels. + + If a datasets in the original file has a label or type, these will be + stored in the corresponding 'lable' and 'SAStype' attributes, which + can be accessed by the \code{\link{label}} and \code{\link{SAStype}} + functions. } \author{ Gregory R. Warnes \email{gr...@wa...} based on \code{Hmisc:::sasxport.get} by Frank E. Harrell, Jr.} @@ -110,7 +120,11 @@ \code{\link[chron]{chron}}, \code{\link[foreign]{lookup.xport}}, \code{\link[Hmisc]{contents}}, - \code{\link[Hmisc]{describe}} + \code{\link[Hmisc]{describe}}, + \code{\link{label}}, + \code{\link{SASformat}}, + \code{\link{SASiformat}}, and + \code{\link{SAStype}} } \examples{ Modified: trunk/SASxport/man/write.xport.Rd =================================================================== --- trunk/SASxport/man/write.xport.Rd 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/man/write.xport.Rd 2013-05-12 01:48:49 UTC (rev 1660) @@ -39,9 +39,10 @@ converted to upper case. All characters outside of the set A-Z, 0-9, and '\_' are converted to '\_'. \item Character variables are stored as characters. - \item If \code{autogen.formats=TRUE} (the default), factor variables are stored as numeric with an appropriate SAS - format specification. If \code{autogen.formats=FALSE}, factor - variables are stored as characters. + \item If \code{autogen.formats=TRUE} (the default), factor variables + are stored as numeric with an appropriate SAS format + specification. If \code{autogen.formats=FALSE}, factor variables + are stored as characters. \item All numeric variables are stored as double-precision floating point values utilizing the IBM mainframe double precision floating point format (see the reference). @@ -52,13 +53,18 @@ '.' } - In addition, the SAS XPORT format allows each variable to have a - corresponding label, display format, and input format. To set these - values, add the attribute 'label', 'SASformat', or 'SASiformat' to - individual data frame variables. (See the example section.) + The SAS XPORT format allows each dataset to have a label and a type + (set via the \code{\link{label}} and \code{\link{SAStype}} functions). + In addition, each variable may have a corresponding label, display + format, and input format. To set these values, add the attribute + 'label', 'SASformat', or 'SASiformat' to individual data frame. These + attributes may be set using the \code{\link{label}}, + \code{\link{SASformat}}, and \code{\link{SASiformat}} functions. (See + examples provided below.) The actual translation of R objects to objects appropriate for SAS is - handled by the \code{\link{toSAS}} generic and associated methods. + handled by the \code{\link{toSAS}} generic and associated methods, + which can be (re)defined by the user to provide fine-grained control. } \value{ No return value @@ -76,7 +82,11 @@ \seealso{ \code{\link{toSAS}}, \code{\link{lookup.xport}}, - \code{\link{read.xport}} + \code{\link{read.xport}}, + \code{\link{label}}, + \code{\link{SAStype}}, + \code{\link{SASformat}}, + and \code{\link{SASiformat}} } \examples{ @@ -85,23 +95,24 @@ ##### ## manually create a data set -temp <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) +abc <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) ## look at it -temp +abc ## add a format specifier (not used by R) -attr(temp$x, 'SASformat') <- 'date7.' +SASformat(abc$x) <- 'date7.' ## add a variable label (not used by R) -attr(temp$y, 'label') <- 'character variable' +label(abc$y) <- 'character variable' +## add a dataset label and type +label(abc) <- 'Simple example' +SAStype(abc) <- 'MYTYPE' + ## verify the additions -str(temp) +str(abc) -## rename the data set -abc <- temp - # create a SAS XPORT file write.xport( abc, file="xxx.dat" ) @@ -114,7 +125,12 @@ ## and look at it xxx.abc -## Note that the variable names have been converted to uppercase +## Check the label and type +label(xxx.abc) +SAStype(xxx.abc) +## Note that the variable names and SAS dataset type have been converted +## to uppercase + } \keyword{file} Modified: trunk/SASxport/tests/Alfalfa_Test.Rout.save =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -21,7 +20,7 @@ > > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -47,4 +46,4 @@ > > proc.time() user system elapsed - 0.303 0.025 0.316 + 0.940 0.052 0.985 Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/Theoph.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -23,7 +22,7 @@ > > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -43,4 +42,4 @@ > > proc.time() user system elapsed - 0.539 0.026 0.555 + 1.632 0.084 1.705 Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/cars.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -64,4 +63,4 @@ > > proc.time() user system elapsed - 0.296 0.025 0.310 + 0.904 0.096 0.998 Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/testDates.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -62,4 +61,4 @@ > > proc.time() user system elapsed - 0.364 0.025 0.378 + 1.112 0.084 1.183 Modified: trunk/SASxport/tests/testDuplicateNames.Rout.save =================================================================== --- trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -156,4 +155,4 @@ > > proc.time() user system elapsed - 0.430 0.031 2.232 + 1.292 0.124 2.566 Modified: trunk/SASxport/tests/testManyNames.Rout.save =================================================================== --- trunk/SASxport/tests/testManyNames.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/testManyNames.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -95,4 +94,4 @@ > > proc.time() user system elapsed - 6.985 0.068 7.099 + 19.392 0.172 19.717 Modified: trunk/SASxport/tests/testNegative.Rout.save =================================================================== --- trunk/SASxport/tests/testNegative.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/testNegative.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -48,4 +47,4 @@ > > proc.time() user system elapsed - 0.423 0.027 0.439 + 1.260 0.072 1.321 Modified: trunk/SASxport/tests/testNumeric.Rout.save =================================================================== --- trunk/SASxport/tests/testNumeric.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/testNumeric.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -87,4 +86,4 @@ > > proc.time() user system elapsed - 0.494 0.025 0.507 + 1.584 0.096 1.673 Modified: trunk/SASxport/tests/testUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -2164,4 +2163,4 @@ > > proc.time() user system elapsed - 2.092 0.073 8.083 + 6.024 1.684 14.087 Modified: trunk/SASxport/tests/test_as_is.Rout.save =================================================================== --- trunk/SASxport/tests/test_as_is.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/test_as_is.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -48,6 +47,8 @@ $ CONC : num 0.02 0.02 0.06 0.06 0.11 0.11 0.22 0.22 0.56 0.56 ... $ RATE : int 76 47 97 107 123 139 159 152 191 201 ... $ STATE: Factor w/ 2 levels "treated","untreated": 1 1 1 1 1 1 1 1 1 1 ... + - attr(*, "label")= chr " " + - attr(*, "SAStype")= chr " " > > SASxport:::assert( class(x$STATE)=="factor" ) > @@ -60,6 +61,8 @@ $ CONC : num 0.02 0.02 0.06 0.06 0.11 0.11 0.22 0.22 0.56 0.56 ... $ RATE : int 76 47 97 107 123 139 159 152 191 201 ... $ STATE: chr "treated" "treated" "treated" "treated" ... + - attr(*, "label")= chr " " + - attr(*, "SAStype")= chr " " > > SASxport:::assert( class(x$STATE)=="character" ) > @@ -67,4 +70,4 @@ > > proc.time() user system elapsed - 0.269 0.024 0.282 + 0.860 0.112 0.996 Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/test_fields.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -32,4 +31,4 @@ > > proc.time() user system elapsed - 0.240 0.023 0.252 + 0.756 0.056 0.820 Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/xport.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -106,4 +105,4 @@ > q() > proc.time() user system elapsed - 0.286 0.025 0.300 + 0.908 0.108 1.018 Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2013-05-12 00:55:24 UTC (rev 1659) +++ trunk/SASxport/tests/xxx.Rout.save 2013-05-12 01:48:49 UTC (rev 1660) @@ -1,8 +1,7 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 -Platform: i386-apple-darwin9.8.0/i386 (32-bit) +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing +Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -18,7 +17,7 @@ > library(SASxport) -Loaded SASxport version 1.3.0 (2012-06-29). +Loaded SASxport version 1.3.2 (2013-05-11). Type `?SASxport' for usage information. @@ -67,7 +66,7 @@ > ## 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. +> ## avoid a comparison error for this known limitation. > > a.1[1089] <- as.raw("0x2e") > @@ -79,4 +78,4 @@ > > proc.time() user system elapsed - 0.287 0.027 0.303 + 0.908 0.092 0.991 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-12 00:55:27
|
Revision: 1659 http://sourceforge.net/p/r-gregmisc/code/1659 Author: warnes Date: 2013-05-12 00:55:24 +0000 (Sun, 12 May 2013) Log Message: ----------- Complete work to handle dataframe label and type Modified Paths: -------------- trunk/SASxport/NAMESPACE trunk/SASxport/R/SAStype.R trunk/SASxport/R/read.xport.R trunk/SASxport/src/SASxport.c trunk/SASxport/tests/dfAttributes.R Modified: trunk/SASxport/NAMESPACE =================================================================== --- trunk/SASxport/NAMESPACE 2013-05-11 23:41:36 UTC (rev 1658) +++ trunk/SASxport/NAMESPACE 2013-05-12 00:55:24 UTC (rev 1659) @@ -35,12 +35,12 @@ S3method(label, default) S3method(SASformat, default) S3method(SASiformat, default) -S3method(SAStype, data.frame) +S3method(SAStype, default) S3method("label<-", default) S3method("SASformat<-", default) S3method("SASiformat<-", default) -S3method("SAStype<-", data.frame) +S3method("SAStype<-", default) S3method(print, lookup.xport) S3method(summary, lookup.xport) Modified: trunk/SASxport/R/SAStype.R =================================================================== --- trunk/SASxport/R/SAStype.R 2013-05-11 23:41:36 UTC (rev 1658) +++ trunk/SASxport/R/SAStype.R 2013-05-12 00:55:24 UTC (rev 1659) @@ -1,7 +1,7 @@ SAStype <- function(x, default) UseMethod("SAStype") -SAStype.data.frame <- function(x, default=NULL) +SAStype.default <- function(x, default=NULL) { lab <- attr(x,"SAStype") if(is.null(lab)) @@ -13,7 +13,7 @@ "SAStype<-" <- function(x, value) UseMethod("SAStype<-") -"SAStype<-.data.frame" <- function(x, value) +"SAStype<-.default" <- function(x, value) { attr(x,'SAStype') <- value x Modified: trunk/SASxport/R/read.xport.R =================================================================== --- trunk/SASxport/R/read.xport.R 2013-05-11 23:41:36 UTC (rev 1658) +++ trunk/SASxport/R/read.xport.R 2013-05-12 00:55:24 UTC (rev 1659) @@ -48,6 +48,9 @@ scat("Extracting data file information...") dsinfo <- lookup.xport.inner(file) + dsLabels <- sapply(dsinfo, label) + dsTypes <- sapply(dsinfo, SAStype) + if(length(keep)) whichds <- toupper(keep) else @@ -123,6 +126,9 @@ next } + label(w) <- dsLabels[k] + SAStype(w) <- dsTypes[k] + nam <- names.tolower(makeNames(names(w), allow=name.chars)) names(w) <- nam dinfo <- dsinfo[[k]] Modified: trunk/SASxport/src/SASxport.c =================================================================== --- trunk/SASxport/src/SASxport.c 2013-05-11 23:41:36 UTC (rev 1658) +++ trunk/SASxport/src/SASxport.c 2013-05-12 00:55:24 UTC (rev 1659) @@ -22,6 +22,7 @@ */ #include <stdio.h> +#include <ctype.h> #include <string.h> #include <R.h> #include <Rinternals.h> @@ -266,25 +267,21 @@ name[n] = '\0'; } else name[0] = '\0'; - /* Extract data set label */ - tmp = strchr(mem_head->sas_dslabel, ' '); - n = tmp - mem_head->sas_dslabel; - if(n > 0) { - if (n > 40) - n = 40; - strncpy(dslabel, mem_head->sas_dslabel, n); - dslabel[n] = '\0'; - } else dslabel[0] = '\0'; + /* Extract data set label, and trim trailing blanks */ + strncpy(dslabel, mem_head->sas_dslabel, 40); + for(int i=40-1; i>0; i--) + if( isspace(dslabel[i]) ) + dslabel[i] = '\0'; + else + break; /* Extract data set type */ - tmp = strchr(mem_head->sas_dstype, ' '); - n = tmp - mem_head->sas_dstype; - if(n > 0) { - if (n > 40) - n = 40; - strncpy(dstype, mem_head->sas_dstype, n); - dstype[n] = '\0'; - } else dstype[0] = '\0'; + strncpy(dstype, mem_head->sas_dstype, 8); + for(int i=8-1; i>0; i--) + if( isspace(dstype[i]) ) + dstype[i] = '\0'; + else + break; Free(mem_head); @@ -595,9 +592,14 @@ PROTECT(varInfo = allocVector(VECSXP, VAR_INFO_LENGTH)); setAttrib(varInfo, R_NamesSymbol, varInfoNames); - PROTECT(dfLabel = mkChar(dslabel)); - PROTECT(dfType = mkChar(dstype) ); + dslabel[40] = '\n'; + PROTECT(dfLabel = allocVector(STRSXP, 1)); + SET_STRING_ELT(dfLabel, 0, mkChar(dslabel)); setAttrib(varInfo, install("label" ), dfLabel); + + dstype[8] = '\n'; + PROTECT(dfType = allocVector(STRSXP, 1)); + SET_STRING_ELT(dfType, 0, mkChar(dstype)); setAttrib(varInfo, install("SAStype"), dfType ); SET_XPORT_VAR_TYPE(varInfo, allocVector(STRSXP, memLength)); Modified: trunk/SASxport/tests/dfAttributes.R =================================================================== --- trunk/SASxport/tests/dfAttributes.R 2013-05-11 23:41:36 UTC (rev 1658) +++ trunk/SASxport/tests/dfAttributes.R 2013-05-12 00:55:24 UTC (rev 1659) @@ -4,7 +4,7 @@ abc.out <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) ## add a data set label (not used by R) -label(abc.out) <- "data set" +label(abc.out) <- "xxxx data set xxxxx" SAStype(abc.out) <- "normal" ## add a format specifier (not used by R) @@ -15,7 +15,7 @@ # create a SAS XPORT file from our local data frame write.xport(abc.out, - file="xxx2.xpt", + file="dfAttributes.xpt", cDate=strptime("28JUL07:21:08:06 ", format="%d%b%y:%H:%M:%S"), osType="SunOS", sasVer="9.1", @@ -23,16 +23,16 @@ ) # read the SAS data back in -abc.in <- read.xport("xxx2.xpt", names.tolower=FALSE) +abc.in <- read.xport("dfAttributes.xpt", names.tolower=FALSE) ## Test that the files are otherwise identical -label(abc.out, "missing!") -label(abc.in , "missing!") +label(abc.out, "MISSING!") +label(abc.in , "MISSING!") -SAStype(abc.out, "missing!") -SAStype(abc.in , "missing!") +SAStype(abc.out, "MISSING!") +SAStype(abc.in , "MISSING!") -stopifnot( label(abc.out)==label(abc.in, "missing!") ) -stopifnot( SAStype(abc.out)==SAStype(abc.in, "missing!") ) +stopifnot( label (abc.out, "MISSING!")==label (abc.in, "MISSING!") ) +stopifnot( SAStype(abc.out, "MISSING!")==SAStype(abc.in, "MISSING!") ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-11 23:41:38
|
Revision: 1658 http://sourceforge.net/p/r-gregmisc/code/1658 Author: warnes Date: 2013-05-11 23:41:36 +0000 (Sat, 11 May 2013) Log Message: ----------- Add support for dataset labels and types Modified Paths: -------------- trunk/SASxport/NAMESPACE trunk/SASxport/R/write.xport.R trunk/SASxport/R/xport.member.header.R trunk/SASxport/man/label.Rd trunk/SASxport/src/SASxport.c trunk/SASxport/src/SASxport.h trunk/SASxport/src/init.c trunk/SASxport/src/writeSAS.c trunk/SASxport/src/writeSAS.h Added Paths: ----------- trunk/SASxport/R/SAStype.R Modified: trunk/SASxport/NAMESPACE =================================================================== --- trunk/SASxport/NAMESPACE 2013-05-11 23:32:35 UTC (rev 1657) +++ trunk/SASxport/NAMESPACE 2013-05-11 23:41:36 UTC (rev 1658) @@ -17,9 +17,12 @@ "SASformat<-", "SASiformat", - "SASiformat<-" - ) + "SASiformat<-", + "SAStype", + "SAStype<-" +) + S3method(toSAS, numeric) S3method(toSAS, logical) S3method(toSAS, character) @@ -32,10 +35,12 @@ S3method(label, default) S3method(SASformat, default) S3method(SASiformat, default) +S3method(SAStype, data.frame) S3method("label<-", default) S3method("SASformat<-", default) S3method("SASiformat<-", default) +S3method("SAStype<-", data.frame) S3method(print, lookup.xport) S3method(summary, lookup.xport) Added: trunk/SASxport/R/SAStype.R =================================================================== --- trunk/SASxport/R/SAStype.R (rev 0) +++ trunk/SASxport/R/SAStype.R 2013-05-11 23:41:36 UTC (rev 1658) @@ -0,0 +1,20 @@ +SAStype <- function(x, default) + UseMethod("SAStype") + +SAStype.data.frame <- function(x, default=NULL) +{ + lab <- attr(x,"SAStype") + if(is.null(lab)) + default + else + lab +} + +"SAStype<-" <- function(x, value) + UseMethod("SAStype<-") + +"SAStype<-.data.frame" <- function(x, value) +{ + attr(x,'SAStype') <- value + x +} Modified: trunk/SASxport/R/write.xport.R =================================================================== --- trunk/SASxport/R/write.xport.R 2013-05-11 23:32:35 UTC (rev 1657) +++ trunk/SASxport/R/write.xport.R 2013-05-11 23:41:36 UTC (rev 1658) @@ -155,8 +155,12 @@ offsetTable <- data.frame("name"=varNames, "len"=NA, "offset"=NA ) rownames(offsetTable) <- offsetTable[,"name"] + dfLabel <- label(df, default="" ) + dfType <- SAStype(df, default="") + scat("Write data frame header ...") - out( xport.member.header(dfName=i, cDate=cDate, sasVer=sasVer, osType=osType ) ) + out( xport.member.header(dfName=i, cDate=cDate, sasVer=sasVer, osType=osType, + dfLabel=dfLabel, dfType=dfType) ) scat("Done.") scat("Write variable information block header ...") Modified: trunk/SASxport/R/xport.member.header.R =================================================================== --- trunk/SASxport/R/xport.member.header.R 2013-05-11 23:32:35 UTC (rev 1657) +++ trunk/SASxport/R/xport.member.header.R 2013-05-11 23:41:36 UTC (rev 1658) @@ -1,12 +1,15 @@ `xport.member.header` <- -function( dfName, cDate=Sys.time(), mDate=cDate, sasVer="7.00", osType="Unknown" ) +function(dfName, cDate=Sys.time(), mDate=cDate, sasVer="7.00", osType="Unknown", + dfLabel="", dfType="" ) { .C("fill_member_header", dfName = toupper(as.character(dfName)), # Name of data set sasVer = toupper(as.character(sasVer)), # SAS version number osType = as.character(osType), # Operating System (can include lowercase) - cDate = xport.dateFMT(cDate), # Creation date - mDate = xport.dateFMT(mDate), # modification date + cDate = xport.dateFMT(cDate), # Creation date + mDate = xport.dateFMT(mDate), # modification date + dfLabel= as.character(dfLabel), # Data set label + dfType = as.character(dfType), # Data set type PACKAGE="SASxport" ) Modified: trunk/SASxport/man/label.Rd =================================================================== --- trunk/SASxport/man/label.Rd 2013-05-11 23:32:35 UTC (rev 1657) +++ trunk/SASxport/man/label.Rd 2013-05-11 23:41:36 UTC (rev 1658) @@ -15,13 +15,18 @@ \alias{SASiformat<-} \alias{SASiformat<-.default} +\alias{SAStype} +\alias{SAStype.default} +\alias{SAStype<-} +\alias{SAStype<-.default} \title{ -Set or Retreive the 'label', 'SASformat', or 'SASiformat' Attribute of a Vector +Set or Retreive the 'label', 'SASformat', 'SASiformat', or 'SAStype' +attribute of a vector or (components of) a data frame } \description{ - Sets or retrieves the \code{"label"}, \code{"SASformat"}, or - \code{"SASiformat"} attribute of an object. + Sets or retrieves the \code{"label"}, \code{"SASformat"}, + \code{"SASiformat"}, or \code{SAStype} attribute of an object. More comprehensive support for object labels, and SASformat, are available in Frank Harrell's \code{Hmisc} package. @@ -36,18 +41,20 @@ SASiformat(x, default) SASiformat(x) <- value +SAStype(x, default) +SAStype(x) <- value } \arguments{ \item{x}{any object} -\item{value}{new value for the \code{"label"}, \code{"SASformat"}, or - \code{"SASiformat"} attribute of an object.} +\item{value}{new value for the \code{"label"}, \code{"SASformat"}, + \code{"SASiformat"}, or \code{SAStype} attribute of an object.} \item{default}{value to return when no appropriate attribute is found. The usual return value is NULL.} } \value{ - the contents of the \code{"label"}, \code{"SASformat"}, or - \code{"SASiformat"} attribute of x, if any; otherwise, the value provided - by \code{default}. + the contents of the \code{"label"}, \code{"SASformat"}, + \code{"SASiformat"}, \code{"SAStype"} attribute of x, if any; + otherwise, the value provided by \code{default}. } \author{ Gregory R. Warnes \email{gr...@wa...} based on code from the @@ -57,6 +64,8 @@ %} \examples{ +## Examples for vectors + fail.time <- c(10,20) # set attributes @@ -72,20 +81,24 @@ # display all attributes attributes(fail.time) -# Example showing specification of default return value +## SAStype only applies to data frames +df <- data.frame( fail.time, day=c("Mon","Tue") ) +label(df) <- "Data frame object" +SAStype(df) <- "USER" + +label(df) +SAStype(df) + +## Example showing specification of default return value a <- 70 label(a, default="no label") - \dontrun{ -# for a nice display +# Hmisc packages functions label attributes for annotating tables and plots: library(Hmisc) +label(fail.time) describe(fail.time) - -f <- cph(Surv(fail.time, event) ~ xx) -plot(xx,xx2,xlab=label(xx),"s",sep="")) } - } \keyword{utilities} \keyword{interface} Modified: trunk/SASxport/src/SASxport.c =================================================================== --- trunk/SASxport/src/SASxport.c 2013-05-11 23:32:35 UTC (rev 1657) +++ trunk/SASxport/src/SASxport.c 2013-05-11 23:41:36 UTC (rev 1658) @@ -194,9 +194,12 @@ n = GET_RECORD(record, fp, 80); if(n != 80) return 0; + record[80] = '\0'; memcpy(member->sas_mod, record, 16); - if((strrchr(record+16, ' ') - record) != 79) - return 0; + + memcpy(member->sas_dslabel, record+32, 40); + memcpy(member->sas_dstype, record+72, 8); + return 1; } @@ -230,7 +233,7 @@ } static int -init_mem_info(FILE *fp, char *name) +init_mem_info(FILE *fp, char *name, char *dslabel, char *dstype) { int length, n; char record[81]; @@ -253,6 +256,7 @@ record[58] = '\0'; sscanf(record+54, "%d", &length); + /* Extract data set name */ tmp = strchr(mem_head->sas_dsname, ' '); n = tmp - mem_head->sas_dsname; if(n > 0) { @@ -262,6 +266,26 @@ name[n] = '\0'; } else name[0] = '\0'; + /* Extract data set label */ + tmp = strchr(mem_head->sas_dslabel, ' '); + n = tmp - mem_head->sas_dslabel; + if(n > 0) { + if (n > 40) + n = 40; + strncpy(dslabel, mem_head->sas_dslabel, n); + dslabel[n] = '\0'; + } else dslabel[0] = '\0'; + + /* Extract data set type */ + tmp = strchr(mem_head->sas_dstype, ' '); + n = tmp - mem_head->sas_dstype; + if(n > 0) { + if (n > 40) + n = 40; + strncpy(dstype, mem_head->sas_dstype, n); + dstype[n] = '\0'; + } else dstype[0] = '\0'; + Free(mem_head); return length; @@ -542,8 +566,11 @@ FILE *fp; int i, namestrLength, memLength, ansLength; char dsname[9]; + char dslabel[41]; + char dstype[9]; SEXP ans, ansNames, varInfoNames, varInfo; SEXP char_numeric, char_character; + SEXP dfLabel, dfType; PROTECT(varInfoNames = allocVector(STRSXP, VAR_INFO_LENGTH)); for(i = 0; i < VAR_INFO_LENGTH; i++) @@ -561,13 +588,18 @@ ansLength = 0; PROTECT(ans = allocVector(VECSXP, 0)); - PROTECT(ansNames = allocVector(STRSXP, 0)); + PROTECT(ansNames = allocVector(STRSXP, 0)); - while(namestrLength > 0 && (memLength = init_mem_info(fp, dsname)) > 0) { + while(namestrLength > 0 && (memLength = init_mem_info(fp, dsname, dslabel, dstype)) > 0) { PROTECT(varInfo = allocVector(VECSXP, VAR_INFO_LENGTH)); setAttrib(varInfo, R_NamesSymbol, varInfoNames); + PROTECT(dfLabel = mkChar(dslabel)); + PROTECT(dfType = mkChar(dstype) ); + setAttrib(varInfo, install("label" ), dfLabel); + setAttrib(varInfo, install("SAStype"), dfType ); + SET_XPORT_VAR_TYPE(varInfo, allocVector(STRSXP, memLength)); SET_XPORT_VAR_WIDTH(varInfo, allocVector(INTSXP, memLength)); SET_XPORT_VAR_INDEX(varInfo, allocVector(INTSXP, memLength)); @@ -611,7 +643,8 @@ char_character); } PROTECT(ans = lengthgets(ans, ansLength+1)); - PROTECT(ansNames = lengthgets(ansNames, ansLength+1)); + PROTECT(ansNames = lengthgets(ansNames, ansLength+1)); + /* PROTECT(newAns = allocVector(VECSXP, ansLength+1)); */ /* PROTECT(newAnsNames = allocVector(STRSXP, ansLength+1)); */ @@ -622,15 +655,16 @@ /* ans = newAns; */ /* ansNames = newAnsNames; */ - SET_STRING_ELT(ansNames, ansLength, mkChar(dsname)); + SET_STRING_ELT(ansNames , ansLength, mkChar(dsname )); SET_VECTOR_ELT(ans, ansLength, varInfo); ansLength++; - UNPROTECT(5); + UNPROTECT(7); PROTECT(ans); PROTECT(ansNames); } + setAttrib(ans, R_NamesSymbol, ansNames); UNPROTECT(5); fclose(fp); Modified: trunk/SASxport/src/SASxport.h =================================================================== --- trunk/SASxport/src/SASxport.h 2013-05-11 23:32:35 UTC (rev 1657) +++ trunk/SASxport/src/SASxport.h 2013-05-11 23:41:36 UTC (rev 1658) @@ -50,6 +50,9 @@ char sas_osname[8]; char sas_create[16]; char sas_mod[16]; + char sas_dslabel[40]; + char sas_dstype[8]; + }; struct SAS_XPORT_namestr { Modified: trunk/SASxport/src/init.c =================================================================== --- trunk/SASxport/src/init.c 2013-05-11 23:32:35 UTC (rev 1657) +++ trunk/SASxport/src/init.c 2013-05-11 23:41:36 UTC (rev 1658) @@ -31,7 +31,8 @@ #define ARGTYPE static R_NativePrimitiveArgType ARGTYPE fill_file_header_args[] = { STRSXP, STRSXP, STRSXP, STRSXP }; -ARGTYPE fill_member_header_args[] = { STRSXP, STRSXP, STRSXP, STRSXP, STRSXP }; +ARGTYPE fill_member_header_args[] = { STRSXP, STRSXP, STRSXP, STRSXP, STRSXP, STRSXP, + STRSXP }; ARGTYPE fill_namestr_args[] = { INTSXP, INTSXP, INTSXP, STRSXP, STRSXP, STRSXP, INTSXP, INTSXP, INTSXP, STRSXP, INTSXP, INTSXP, INTSXP }; @@ -43,7 +44,7 @@ #define CDEF(name, narg, argVec) { #name, (DL_FUNC) &name, narg, argVec } static const R_CMethodDef CEntries[] = { CDEF(fill_file_header, 4, fill_file_header_args ), - CDEF(fill_member_header, 5, fill_member_header_args ), + CDEF(fill_member_header, 7, fill_member_header_args ), CDEF(fill_namestr, 13, fill_namestr_args ), CDEF(fill_namestr_header, 1, fill_namestr_header_args ), CDEF(fill_obs_header, 0, 0 ), Modified: trunk/SASxport/src/writeSAS.c =================================================================== --- trunk/SASxport/src/writeSAS.c 2013-05-11 23:32:35 UTC (rev 1657) +++ trunk/SASxport/src/writeSAS.c 2013-05-11 23:41:36 UTC (rev 1658) @@ -149,11 +149,13 @@ void fill_member_header( - char **dfName, /* Name of data set */ - char **sasVer, /* SAS version number*/ - char **osType, /* Operating System */ - char **cDate, /* Creation date */ - char **mDate /* Modification date */ + char **dfName, /* Name of data set */ + char **sasVer, /* SAS version number */ + char **osType, /* Operating System */ + char **cDate, /* Creation date */ + char **mDate, /* Modification date */ + char **dfLabel, /* Label of data set */ + char **dfType /* Type of data set */ ) { struct MEMBER_HEADER member_header; @@ -175,8 +177,11 @@ /* Line 4 */ blankCopy( member_header.sas_modified,16, mDate[0] ); - blankFill( member_header.blanks2, 64); + blankFill( member_header.padding, 16); + blankCopy( member_header.dslabel, 40, dfLabel[0] ); + blankCopy( member_header.dstype, 8, dfType[0] ); + /* Copy over for return */ memcpy( raw_buffer, &member_header, sizeof(member_header) ); Modified: trunk/SASxport/src/writeSAS.h =================================================================== --- trunk/SASxport/src/writeSAS.h 2013-05-11 23:32:35 UTC (rev 1657) +++ trunk/SASxport/src/writeSAS.h 2013-05-11 23:41:36 UTC (rev 1658) @@ -103,7 +103,10 @@ /* Line 4 */ char sas_modified[16]; - char blanks2[64]; + //char blanks2[64]; + char padding[16]; + char dslabel[40]; + char dstype[8]; }; @@ -155,7 +158,7 @@ void fill_file_header(char **cDate, char **mDate, char **sasVer, char **osType); void fill_member_header(char **dfName, char **sasVer, char **osType, char **cDate, - char **mDate); + char **mDate, char **dfLabel, char **dfType); void fill_namestr(int *isChar, int *nlng, int *nvar0, char **nname, char **nlabel, char **nform, int *nfl, int *nfd, int *nfj, char **niform, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-11 23:32:38
|
Revision: 1657 http://sourceforge.net/p/r-gregmisc/code/1657 Author: warnes Date: 2013-05-11 23:32:35 +0000 (Sat, 11 May 2013) Log Message: ----------- Fix spelling error Modified Paths: -------------- trunk/SASxport/tests/xxx.R Added Paths: ----------- trunk/SASxport/tests/dfAttributes.R Copied: trunk/SASxport/tests/dfAttributes.R (from rev 1649, trunk/SASxport/tests/xxx.R) =================================================================== --- trunk/SASxport/tests/dfAttributes.R (rev 0) +++ trunk/SASxport/tests/dfAttributes.R 2013-05-11 23:32:35 UTC (rev 1657) @@ -0,0 +1,38 @@ +library(SASxport) + +## manually create a data set +abc.out <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) ) + +## add a data set label (not used by R) +label(abc.out) <- "data set" +SAStype(abc.out) <- "normal" + +## add a format specifier (not used by R) +SASformat(abc.out$x) <- 'date7.' + +## add a variable label (not used by R) +label(abc.out$y) <- 'character variable' + +# create a SAS XPORT file from our local data frame +write.xport(abc.out, + file="xxx2.xpt", + cDate=strptime("28JUL07:21:08:06 ", format="%d%b%y:%H:%M:%S"), + osType="SunOS", + sasVer="9.1", + autogen.formats=FALSE + ) + +# read the SAS data back in +abc.in <- read.xport("xxx2.xpt", names.tolower=FALSE) + +## Test that the files are otherwise identical +label(abc.out, "missing!") +label(abc.in , "missing!") + +SAStype(abc.out, "missing!") +SAStype(abc.in , "missing!") + +stopifnot( label(abc.out)==label(abc.in, "missing!") ) +stopifnot( SAStype(abc.out)==SAStype(abc.in, "missing!") ) + + Modified: trunk/SASxport/tests/xxx.R =================================================================== --- trunk/SASxport/tests/xxx.R 2013-05-11 20:31:15 UTC (rev 1656) +++ trunk/SASxport/tests/xxx.R 2013-05-11 23:32:35 UTC (rev 1657) @@ -44,7 +44,7 @@ ## 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. +## avoid a comparison error for this known limitation. a.1[1089] <- as.raw("0x2e") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-11 20:31:18
|
Revision: 1656 http://sourceforge.net/p/r-gregmisc/code/1656 Author: warnes Date: 2013-05-11 20:31:15 +0000 (Sat, 11 May 2013) Log Message: ----------- Update for version 1.3.2 Modified Paths: -------------- trunk/SASxport/inst/NEWS Modified: trunk/SASxport/inst/NEWS =================================================================== --- trunk/SASxport/inst/NEWS 2013-05-11 20:22:57 UTC (rev 1655) +++ trunk/SASxport/inst/NEWS 2013-05-11 20:31:15 UTC (rev 1656) @@ -1,3 +1,20 @@ +Version 1.3.2 2013-05-11 +------------------------ + +Bug fixes: + +- Integrate patch from foreign package to properly handle xport files + with datasets that end exactly on an 80-byte record boundry & add + corresponding test file. + +- Replace file.path(path.package(...)) with system.file(...) + +Changes: + +- Remove oboslete .First.lib() function + +- Replace file.path(path.package(...)) with system.file(...) + Version 1.3.1 2013-03-24 ------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-11 20:23:00
|
Revision: 1655 http://sourceforge.net/p/r-gregmisc/code/1655 Author: warnes Date: 2013-05-11 20:22:57 +0000 (Sat, 11 May 2013) Log Message: ----------- Update for release 1.3.2 Modified Paths: -------------- trunk/SASxport/DESCRIPTION Modified: trunk/SASxport/DESCRIPTION =================================================================== --- trunk/SASxport/DESCRIPTION 2013-05-11 20:11:36 UTC (rev 1654) +++ trunk/SASxport/DESCRIPTION 2013-05-11 20:22:57 UTC (rev 1655) @@ -1,8 +1,8 @@ Package: SASxport Type: Package Title: Read and Write SAS XPORT Files -Version: 1.3.1 -Date: 2013-03-24 +Version: 1.3.2 +Date: 2013-05-11 Description: This package provides functions for reading, listing the contents of, and writing SAS xport format files. The functions support reading and writing of either This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-11 20:11:39
|
Revision: 1654 http://sourceforge.net/p/r-gregmisc/code/1654 Author: warnes Date: 2013-05-11 20:11:36 +0000 (Sat, 11 May 2013) Log Message: ----------- Fix spelling error. Modified Paths: -------------- trunk/SASxport/R/write.xport.R trunk/SASxport/R/zzz.R Modified: trunk/SASxport/R/write.xport.R =================================================================== --- trunk/SASxport/R/write.xport.R 2013-05-11 20:10:12 UTC (rev 1653) +++ trunk/SASxport/R/write.xport.R 2013-05-11 20:11:36 UTC (rev 1654) @@ -123,8 +123,8 @@ if(file==stdout()) out <- function(...) { - cat("ASCII: ", rawToDisplay(...), "") - cat("HEX: ", ..., "") + cat("ASCII: ", rawToDisplay(...), "\n") + cat("HEX: ", ..., "\n") } else out <- function(...) writeBin( ..., raw(), con=file) @@ -159,7 +159,7 @@ out( xport.member.header(dfName=i, cDate=cDate, sasVer=sasVer, osType=osType ) ) scat("Done.") - scat("Write variable informaton block header ...") + scat("Write variable information block header ...") out( xport.namestr.header( nvar=ncol(df) ) ) scat("Done.") Modified: trunk/SASxport/R/zzz.R =================================================================== --- trunk/SASxport/R/zzz.R 2013-05-11 20:10:12 UTC (rev 1653) +++ trunk/SASxport/R/zzz.R 2013-05-11 20:11:36 UTC (rev 1654) @@ -9,7 +9,6 @@ cat("\n") } - .onLoad <- function(lib, pkg) { loadMessage() } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-05-11 20:10:15
|
Revision: 1653 http://sourceforge.net/p/r-gregmisc/code/1653 Author: warnes Date: 2013-05-11 20:10:12 +0000 (Sat, 11 May 2013) Log Message: ----------- Carry bug fix forward to handle loading xport data when a dataset ends on exactly 80 byte block boundry. Modified Paths: -------------- trunk/SASxport/src/SASxport.c trunk/SASxport/src/SASxport.h Added Paths: ----------- trunk/SASxport/src/foreign.h Modified: trunk/SASxport/src/SASxport.c =================================================================== --- trunk/SASxport/src/SASxport.c 2013-05-11 20:06:55 UTC (rev 1652) +++ trunk/SASxport/src/SASxport.c 2013-05-11 20:10:12 UTC (rev 1653) @@ -25,20 +25,9 @@ #include <string.h> #include <R.h> #include <Rinternals.h> -//#include "foreign.h" +#include "foreign.h" #include "SASxport.h" - -#ifdef ENABLE_NLS -#include <libintl.h> -#define _(String) dgettext ("foreign", String) -#define gettext_noop(String) (String) -#else -#define _(String) (String) -#define gettext_noop(String) (String) -#endif - - #define HEADER_BEG "HEADER RECORD*******" #define HEADER_TYPE_LIBRARY "LIBRARY " #define HEADER_TYPE_MEMBER "MEMBER " @@ -153,9 +142,9 @@ int n; n = GET_RECORD(record, fp, 80); - if(n == 80 && strncmp(LIB_HEADER, record, 80) != 0) + if(n != 80 || strncmp(LIB_HEADER, record, 80) != 0) error(_("file not in SAS transfer format")); - + n = GET_RECORD(record, fp, 80); if(n != 80) return 0; @@ -230,8 +219,9 @@ Free(lib_head); n = GET_RECORD(record, fp, 80); - if(n != 80 || strncmp(MEM_HEADER, record, 75) != 0 || - strncmp(" ", record+78, 2) != 0) + if(n != 80 || + strncmp(MEM_HEADER, record, 75) != 0 || + strncmp(" ", record+78, 2) != 0 ) error(_("file not in SAS transfer format")); record[78] = '\0'; sscanf(record+75, "%d", &namestr_length); @@ -297,7 +287,7 @@ { char *tmp; char record[81]; - int i, n, nbytes, totwidth, nlength, restOfCard; + int i, n, totwidth, nlength, restOfCard; struct SAS_XPORT_namestr *nam_head; nam_head = Calloc(nvars, struct SAS_XPORT_namestr); @@ -394,7 +384,6 @@ for(i = 0; i < nvars; i++) totwidth += nlng[i]; - nbytes = 0; nlength = 0; tmp = Calloc(totwidth <= 80 ? 81 : (totwidth+1), char); restOfCard = 0; @@ -433,6 +422,18 @@ break; } } + else /* beware that the previous member can end on card + * boundary with no padding */ + if (restOfCard == 80 && n == 80 && + strncmp(MEM_HEADER, tmp, 75) == 0 && + strncmp(" ", tmp+78, 2) == 0) { + strncpy(record, tmp, 80); + *tailpad = 0; + record[78] = '\0'; + sscanf(record+75, "%d", &namestr_length); + break; + } + if (fsetpos(fp, ¤tPos)) { error(_("problem accessing SAS XPORT file")); } @@ -555,7 +556,7 @@ error(_("first argument must be a file name")); fp = fopen(R_ExpandFileName(CHAR(STRING_ELT(xportFile, 0))), "rb"); if (!fp) - error(_("unable to open file")); + error(_("unable to open file: '%s'"), strerror(errno)); namestrLength = init_xport_info(fp); ansLength = 0; @@ -659,7 +660,7 @@ error(_("first argument must be a file name")); fp = fopen(R_ExpandFileName(CHAR(STRING_ELT(xportFile, 0))), "rb"); if (!fp) - error(_("unable to open file")); + error(_("unable to open file: '%s'"), strerror(errno)); if (fseek(fp, 240, SEEK_SET) != 0) error(_("problem reading SAS XPORT file '%s'"), CHAR(STRING_ELT(xportFile, 0))); Modified: trunk/SASxport/src/SASxport.h =================================================================== --- trunk/SASxport/src/SASxport.h 2013-05-11 20:06:55 UTC (rev 1652) +++ trunk/SASxport/src/SASxport.h 2013-05-11 20:10:12 UTC (rev 1653) @@ -13,11 +13,11 @@ * along with this program; if not, a copy is available at * http://www.r-project.org/Licenses/ */ - + /* * This file is derived from code in the SAS Technical Support * document TS-140 "The Record Layout of a Data Set in SAS Transport - * (XPORT) Format" available as + * (XPORT) Format" available as * http://ftp.sas.com/techsup/download/technote/ts140.html */ @@ -25,13 +25,15 @@ #define SASEXPORT_H #include <string.h> /* for memcpy and memset */ +#include "foreign.h" #include "swap_bytes.h" +#include <errno.h> /* double cnxptiee(double from, int fromtype, int totype); */ -struct SAS_XPORT_header { +struct SAS_XPORT_header { char sas_symbol[2][8]; /* should be "SAS " */ char saslib[8]; /* should be "SASLIB " */ char sasver[8]; @@ -40,11 +42,11 @@ char sas_mod[16]; }; -struct SAS_XPORT_member { +struct SAS_XPORT_member { char sas_symbol[8]; char sas_dsname[8]; char sasdata[8]; - char sasver[8]; + char sasver[8]; char sas_osname[8]; char sas_create[16]; char sas_mod[16]; Added: trunk/SASxport/src/foreign.h =================================================================== --- trunk/SASxport/src/foreign.h (rev 0) +++ trunk/SASxport/src/foreign.h 2013-05-11 20:10:12 UTC (rev 1653) @@ -0,0 +1,77 @@ +/* + * + * Common header file for the foreign package for R + * + * Copyright 2000-2000 Saikat DebRoy <sa...@st...> + * Douglas M. Bates <ba...@st...>, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + */ + +#ifndef FOREIGN_H +#define FOREIGN_H + +#include <R.h> +#include <Rinternals.h> + +#ifdef ENABLE_NLS +#include <libintl.h> +#define _(String) dgettext ("foreign", String) +#define gettext_noop(String) (String) +#else +#define _(String) (String) +#define gettext_noop(String) (String) +#endif + +#define CN_TYPE_BIG 1 +#define CN_TYPE_LITTLE 2 +#define CN_TYPE_XPORT 3 +#define CN_TYPE_IEEEB CN_TYPE_BIG +#define CN_TYPE_IEEEL CN_TYPE_LITTLE + +#define BIG 4321 +#define LITTLE 1234 +#define UNKNOWN 0000 + +#ifdef WORDS_BIGENDIAN +# define CN_TYPE_NATIVE CN_TYPE_IEEEB +# define endian BIG +#else +# define CN_TYPE_NATIVE CN_TYPE_IEEEL +# define endian LITTLE +#endif /* not WORDS_BIGENDIAN */ + +typedef int R_int32; +/* typedef short int16; unused */ + +typedef double R_flt64; +/* typedef float flt32; unused */ + +#define FPREP_IEEE754 754 +#define FPREP FPREP_IEEE754 + +#ifdef max +# undef max +#endif +#ifdef min +# undef min +#endif +#define max(a,b) ((a) >= (b) ? (a) : (b)) +#define min(a,b) ((a) <= (b) ? (a) : (b)) + +#endif /* FOREIGN_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |