r-gregmisc-users Mailing List for R gregmisc package (Page 13)
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-10-11 20:25:00
|
Revision: 1726 http://sourceforge.net/p/r-gregmisc/code/1726 Author: warnes Date: 2013-10-11 20:24:57 +0000 (Fri, 11 Oct 2013) Log Message: ----------- Update files for gplots 2.12.0 Modified Paths: -------------- trunk/gplots/inst/NEWS Modified: trunk/gplots/inst/NEWS =================================================================== --- trunk/gplots/inst/NEWS 2013-10-11 20:24:34 UTC (rev 1725) +++ trunk/gplots/inst/NEWS 2013-10-11 20:24:57 UTC (rev 1726) @@ -1,4 +1,4 @@ -Release 2.11.4 - 2013-10-11 +Release 2.12.0 - 2013-10-11 --------------------------- Enhancements: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-11 20:24:37
|
Revision: 1725 http://sourceforge.net/p/r-gregmisc/code/1725 Author: warnes Date: 2013-10-11 20:24:34 +0000 (Fri, 11 Oct 2013) Log Message: ----------- Update files for gplots 2.12.0 Modified Paths: -------------- trunk/gplots/DESCRIPTION trunk/gplots/inst/NEWS Modified: trunk/gplots/DESCRIPTION =================================================================== --- trunk/gplots/DESCRIPTION 2013-10-11 20:19:22 UTC (rev 1724) +++ trunk/gplots/DESCRIPTION 2013-10-11 20:24:34 UTC (rev 1725) @@ -3,13 +3,13 @@ Description: Various R programming tools for plotting data Depends: R (>= 3.0), gtools, gdata, stats, caTools, grid, KernSmooth, MASS, datasets -Recommends: grid -Suggests: gtools -Version: 2.11.3 -Date: 2013-06-27 +Suggests: gtools, grid +Version: 2.12.0 +Date: 2013-10-11 Author: Gregory R. Warnes, Ben Bolker, Lodewijk Bonebakker, Robert Gentleman, Wolfgang Huber Andy Liaw, Thomas Lumley, Martin Maechler, Arni Magnusson, Steffen Moeller, Marc Schwartz, Bill Venables Maintainer: Gregory R. Warnes <gr...@wa...> License: GPL-2 +NeedsCompilation: No Modified: trunk/gplots/inst/NEWS =================================================================== --- trunk/gplots/inst/NEWS 2013-10-11 20:19:22 UTC (rev 1724) +++ trunk/gplots/inst/NEWS 2013-10-11 20:24:34 UTC (rev 1725) @@ -1,3 +1,18 @@ +Release 2.11.4 - 2013-10-11 +--------------------------- + +Enhancements: + +- Add heatmap.2() parameters to control row and column label rotation + ('srtRow', 'srtCol'), justification ('adjRow', 'adjCol'), and space + from plot edge ('offsetRow', 'offsetCol'). + +Bug Fixes: + +- Fix bug in venn diagram code when number of TRUE cases in each + variable are equal. + + Release 2.11.3 - 2013-06-27 --------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-11 20:19:25
|
Revision: 1724 http://sourceforge.net/p/r-gregmisc/code/1724 Author: warnes Date: 2013-10-11 20:19:22 +0000 (Fri, 11 Oct 2013) Log Message: ----------- Add parameters to control row and column label positioning, rotation, justification, and offset. Modified Paths: -------------- trunk/gplots/R/heatmap.2.R trunk/gplots/man/heatmap.2.Rd Modified: trunk/gplots/R/heatmap.2.R =================================================================== --- trunk/gplots/R/heatmap.2.R 2013-10-11 17:15:54 UTC (rev 1723) +++ trunk/gplots/R/heatmap.2.R 2013-10-11 20:19:22 UTC (rev 1724) @@ -52,6 +52,12 @@ cexCol = 0.2 + 1/log10(nc), labRow = NULL, labCol = NULL, + srtRow = NULL, + srtCol = NULL, + adjRow = c(0,NA), + adjCol = c(NA,0), + offsetRow = 0.5, + offsetCol = 0.5, ## color key + density info key = TRUE, @@ -389,10 +395,79 @@ col=na.color, add=TRUE) } - ## add labels - axis(1, 1:nc, labels= labCol, las= 2, line= -0.5, tick= 0, cex.axis= cexCol) + ## add column labels + if(is.null(srtCol)) + axis(1, + 1:nc, + labels= labCol, + las= 2, + line= -0.5 + offsetCol, + tick= 0, + cex.axis= cexCol, + hadj=adjCol[1], + padj=adjCol[2] + ) + else + { + if(is.numeric(srtCol)) + { + if(missing(adjCol) || is.null(adjCol)) + adjCol=c(1,NA) + + xpd.orig <- par("xpd") + par(xpd=NA) + xpos <- axis(1, 1:nc, labels=rep("", nc), las=2, tick=0) + text(x=xpos, + y=par("usr")[3] - (1.0 + offsetCol) * strheight("M"), + labels=labCol, + ##pos=1, + adj=adjCol, + cex=cexCol, + srt=srtCol) + par(xpd=xpd.orig) + } + else + warning("Invalid value for srtCol ignored.") + } + + ## add row labels + if(is.null(srtRow)) + { + axis(4, + iy, + labels=labRow, + las=2, + line=-0.5+offsetRow, + tick=0, + cex.axis=cexRow, + hadj=adjRow[1], + padj=adjRow[2] + ) + } + else + { + if(is.numeric(srtRow)) + { + xpd.orig <- par("xpd") + par(xpd=NA) + ypos <- axis(4, iy, labels=rep("", nr), las=2, line= -0.5, tick=0) + text(x=par("usr")[2] + (1.0 + offsetRow) * strwidth("M"), + y=ypos, + labels=labRow, + adj=adjRow, + cex=cexRow, + srt=srtRow + ) + par(xpd=xpd.orig) + } + else + warning("Invalid value for srtRow ignored.") + } + + + + ## add row and column headings (xlab, ylab) if(!is.null(xlab)) mtext(xlab, side = 1, line = margins[1] - 1.25) - axis(4, iy, labels= labRow, las= 2, line= -0.5, tick= 0, cex.axis= cexRow) if(!is.null(ylab)) mtext(ylab, side = 4, line = margins[2] - 1.25) ## perform user-specified function Modified: trunk/gplots/man/heatmap.2.Rd =================================================================== --- trunk/gplots/man/heatmap.2.Rd 2013-10-11 17:15:54 UTC (rev 1723) +++ trunk/gplots/man/heatmap.2.Rd 2013-10-11 20:19:22 UTC (rev 1724) @@ -64,6 +64,12 @@ cexCol = 0.2 + 1/log10(nc), labRow = NULL, labCol = NULL, + srtRow = NULL, + srtCol = NULL, + adjRow = c(0,NA), + adjCol = c(NA,0), + offsetRow = 0.5, + offsetCol = 0.5, # color key + density info key = TRUE, @@ -178,6 +184,12 @@ \item{labRow, labCol}{character vectors with row and column labels to use; these default to \code{rownames(x)} or \code{colnames(x)}, respectively.} + \item{srtRow, srtCol}{angle of row/column labels, in degrees from horizontal} + \item{adjRow, adjCol}{2-element vector giving the (left-right, + top-bottom) justification of row/column labels (relative to the text + orientation).} + \item{offsetRow, offsetCol}{Number of character-width spaces to place + between row/column labels and the edge of the plotting region.} % Color key and density info \item{key}{logical indicating whether a color-key should be shown.} \item{keysize}{numeric value indicating the size of the key} @@ -302,6 +314,33 @@ heatmap.2(x, Rowv=NULL, dendrogram="both") ## generate warning! heatmap.2(x, Colv=FALSE, dendrogram="both") ## generate warning! + ## Show effect of row and column label rotation + heatmap.2(x, srtCol=NULL) + heatmap.2(x, srtCol=0, adjCol = c(0.5,1) ) + heatmap.2(x, srtCol=45, adjCol = c(1,1) ) + heatmap.2(x, srtCol=135, adjCol = c(1,0) ) + heatmap.2(x, srtCol=180, adjCol = c(0.5,0) ) + heatmap.2(x, srtCol=225, adjCol = c(0,0) ) ## not very useful + heatmap.2(x, srtCol=270, adjCol = c(0,0.5) ) + heatmap.2(x, srtCol=315, adjCol = c(0,1) ) + heatmap.2(x, srtCol=360, adjCol = c(0.5,1) ) + + heatmap.2(x, srtRow=45, adjRow=c(0, 1) ) + heatmap.2(x, srtRow=45, adjRow=c(0, 1), srtCol=45, adjCol=c(1,1) ) + heatmap.2(x, srtRow=45, adjRow=c(0, 1), srtCol=270, adjCol=c(0,0.5) ) + + ## Show effect of offsetRow/offsetCol (only works when srtRow/srtCol is + ## not also present) + heatmap.2(x, offsetRow=0, offsetCol=0) + heatmap.2(x, offsetRow=1, offsetCol=1) + heatmap.2(x, offsetRow=2, offsetCol=2) + heatmap.2(x, offsetRow=-1, offsetCol=-1) + + heatmap.2(x, srtRow=0, srtCol=90, offsetRow=0, offsetCol=0) + heatmap.2(x, srtRow=0, srtCol=90, offsetRow=1, offsetCol=1) + heatmap.2(x, srtRow=0, srtCol=90, offsetRow=2, offsetCol=2) + heatmap.2(x, srtRow=0, srtCol=90, offsetRow=-1, offsetCol=-1) + ## ## Show effect of z-score scaling within columns, blue-red color scale ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-11 17:15:58
|
Revision: 1723 http://sourceforge.net/p/r-gregmisc/code/1723 Author: warnes Date: 2013-10-11 17:15:54 +0000 (Fri, 11 Oct 2013) Log Message: ----------- Fix bug in getVennCounts.data.frame when number of TRUE cases in each variable are equal. Modified Paths: -------------- trunk/gplots/R/venn.R Modified: trunk/gplots/R/venn.R =================================================================== --- trunk/gplots/R/venn.R 2013-10-09 18:39:35 UTC (rev 1722) +++ trunk/gplots/R/venn.R 2013-10-11 17:15:54 UTC (rev 1723) @@ -22,7 +22,7 @@ if( !all(unique(unlist(l)) %in% c(0,1)) ) stop("Only indicator columns permitted") - l <- sapply( l, function(x) which(as.logical(x))) + l <- lapply( l, function(x) which(as.logical(x))) getVennCounts.list(l) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-09 18:39:39
|
Revision: 1722 http://sourceforge.net/p/r-gregmisc/code/1722 Author: warnes Date: 2013-10-09 18:39:35 +0000 (Wed, 09 Oct 2013) Log Message: ----------- Remove duplicate Imports field Modified Paths: -------------- trunk/SASxport/DESCRIPTION Modified: trunk/SASxport/DESCRIPTION =================================================================== --- trunk/SASxport/DESCRIPTION 2013-10-09 18:25:07 UTC (rev 1721) +++ trunk/SASxport/DESCRIPTION 2013-10-09 18:39:35 UTC (rev 1722) @@ -39,5 +39,4 @@ Maintainer: Gregory R. Warnes <gr...@wa...> License: GPL-2 Depends: R (>= 2.4.0), chron -Imports: chron URL: http://www.warnes.net, http://metruminstitute.org This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-09 18:25:10
|
Revision: 1721 http://sourceforge.net/p/r-gregmisc/code/1721 Author: warnes Date: 2013-10-09 18:25:07 +0000 (Wed, 09 Oct 2013) Log Message: ----------- Update examples 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-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/Alfalfa_Test.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -19,8 +19,9 @@ > ## existing SAS xport file "Alfalfa.xpt" > > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -47,4 +48,4 @@ > > proc.time() user system elapsed - 0.956 0.092 1.147 + 0.972 0.072 1.031 Modified: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/Theoph.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -21,8 +21,9 @@ > #### > > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -43,4 +44,4 @@ > > proc.time() user system elapsed - 1.740 0.136 2.578 + 1.656 0.112 1.878 Modified: trunk/SASxport/tests/cars.Rout.save =================================================================== --- trunk/SASxport/tests/cars.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/cars.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -64,4 +65,4 @@ > > proc.time() user system elapsed - 1.016 0.092 1.399 + 0.972 0.084 1.074 Modified: trunk/SASxport/tests/testDates.Rout.save =================================================================== --- trunk/SASxport/tests/testDates.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/testDates.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -62,4 +63,4 @@ > > proc.time() user system elapsed - 1.176 0.080 1.532 + 1.168 0.116 1.716 Modified: trunk/SASxport/tests/testDuplicateNames.Rout.save =================================================================== --- trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/testDuplicateNames.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -26,79 +27,143 @@ > ##tests > example(read.xport) -rd.xpr> # ------- -rd.xpr> # SAS code to generate test dataset: -rd.xpr> # ------- -rd.xpr> # libname y SASV5XPT "test2.xpt"; -rd.xpr> # -rd.xpr> # PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; -rd.xpr> # PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; -rd.xpr> # data test; -rd.xpr> # LENGTH race 3 age 4; -rd.xpr> # age=30; label age="Age at Beginning of Study"; -rd.xpr> # race=2; -rd.xpr> # d1='3mar2002'd ; -rd.xpr> # dt1='3mar2002 9:31:02'dt; -rd.xpr> # t1='11:13:45't; -rd.xpr> # output; -rd.xpr> # -rd.xpr> # age=31; -rd.xpr> # race=4; -rd.xpr> # d1='3jun2002'd ; -rd.xpr> # dt1='3jun2002 9:42:07'dt; -rd.xpr> # t1='11:14:13't; -rd.xpr> # output; -rd.xpr> # format d1 mmddyy10. dt1 datetime. t1 time. race race.; -rd.xpr> # run; -rd.xpr> # data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; -rd.xpr> # DO i=1 TO 100; -rd.xpr> # x3=ranuni(3); -rd.xpr> # x4=ranuni(5); -rd.xpr> # x5=ranuni(7); -rd.xpr> # x6=ranuni(9); -rd.xpr> # x7=ranuni(11); -rd.xpr> # x8=ranuni(13); -rd.xpr> # output; -rd.xpr> # END; -rd.xpr> # DROP i; -rd.xpr> # RUN; -rd.xpr> # PROC MEANS; RUN; -rd.xpr> # PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; -rd.xpr> # ------ +rd.xpr> ## ------- +rd.xpr> ## SAS code to generate test dataset: +rd.xpr> ## ------- +rd.xpr> ## libname y SASV5XPT "test2.xpt"; +rd.xpr> ## +rd.xpr> ## PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; +rd.xpr> ## PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; +rd.xpr> ## data test; +rd.xpr> ## LENGTH race 3 age 4; +rd.xpr> ## age=30; label age="Age at Beginning of Study"; +rd.xpr> ## race=2; +rd.xpr> ## d1='3mar2002'd ; +rd.xpr> ## dt1='3mar2002 9:31:02'dt; +rd.xpr> ## t1='11:13:45't; +rd.xpr> ## output; +rd.xpr> ## +rd.xpr> ## age=31; +rd.xpr> ## race=4; +rd.xpr> ## d1='3jun2002'd ; +rd.xpr> ## dt1='3jun2002 9:42:07'dt; +rd.xpr> ## t1='11:14:13't; +rd.xpr> ## output; +rd.xpr> ## format d1 mmddyy10. dt1 datetime. t1 time. race race.; +rd.xpr> ## run; +rd.xpr> ## data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; +rd.xpr> ## DO i=1 TO 100; +rd.xpr> ## x3=ranuni(3); +rd.xpr> ## x4=ranuni(5); +rd.xpr> ## x5=ranuni(7); +rd.xpr> ## x6=ranuni(9); +rd.xpr> ## x7=ranuni(11); +rd.xpr> ## x8=ranuni(13); +rd.xpr> ## output; +rd.xpr> ## END; +rd.xpr> ## DROP i; +rd.xpr> ## RUN; +rd.xpr> ## PROC MEANS; RUN; +rd.xpr> ## PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; +rd.xpr> ## ------ rd.xpr> -rd.xpr> # Read this dataset from a local file: +rd.xpr> ## Read this dataset from a local file: +rd.xpr> testFile <- system.file('extdata', 'test2.xpt', package="SASxport") + +rd.xpr> w <- read.xport(testFile) + +rd.xpr> class(w) +[1] "list" + +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 + + rd.xpr> ## Not run: -rd.xpr> ##D w <- read.xport('test2.xpt') +rd.xpr> ##D ## Or read a copy of test2.xpt available on the web: +rd.xpr> ##D url <- 'http://biostat.mc.vanderbilt.edu/wiki/pub/Main/Hmisc/test2.xpt' +rd.xpr> ##D w <- read.xport(url) rd.xpr> ## End(Not run) rd.xpr> -rd.xpr> # Or read a copy of test2.xpt available on the web: -rd.xpr> host <- 'http://biostat.mc.vanderbilt.edu' +rd.xpr> ## We can also get the dataset wrapped in a list +rd.xpr> w <- read.xport(testFile, as.list=TRUE) -rd.xpr> path <- '/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' +rd.xpr> class(w) +[1] "list" -rd.xpr> url <- paste(host,path,sep="") +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 -rd.xpr> w <- read.xport(url) +$z + X3 X4 X5 X6 X7 X8 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 -rd.xpr> # We can also get the dataset wrapped in a list -rd.xpr> w <- read.xport(url, as.list=TRUE) -rd.xpr> # And we can ask for the format information to be included as well. -rd.xpr> w <- read.xport(url, as.list=TRUE, include.formats=TRUE) +rd.xpr> ## And we can ask for the format information to be included as well. +rd.xpr> w <- read.xport(testFile, as.list=TRUE, include.formats=TRUE) +rd.xpr> class(w) +[1] "list" + +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 + +$FORMATS + FMTNAME START END LABEL MIN MAX DEFAULT LENGTH FUZZ +1 RACE 1 1 green 1 40 6 6 1e-12 +2 RACE 2 2 blue 1 40 6 6 1e-12 +3 RACE 3 3 purple 1 40 6 6 1e-12 + PREFIX MULT FILL NOEDIT TYPE SEXCL EEXCL HLO DECSEP DIG3SEP DATATYPE LANGUAGE +1 0 0 N N N +2 0 0 N N N +3 0 0 N N N + + rd.xpr> ## Don't show: -rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) +rd.xpr> stopifnot( is.data.frame(w)==FALSE && is.list(w)==TRUE ) rd.xpr> ## End Don't show rd.xpr> rd.xpr> rd.xpr> ## Not run: -rd.xpr> ##D ## The Hmisc library provides many useful functions for interacting with -rd.xpr> ##D ## data imported from SAS via read.xport() +rd.xpr> ##D #### The Hmisc library provides many useful functions for interacting with +rd.xpr> ##D #### data imported from SAS via read.xport() rd.xpr> ##D library(Hmisc) rd.xpr> ##D rd.xpr> ##D describe(w$test) # see labels, format names for dataset test -rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detaiil for each variable +rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detail for each variable rd.xpr> ##D rd.xpr> ##D contents(w$test) # another way to see variable attributes rd.xpr> ##D lapply(w, contents)# show contents of individual items in more detail @@ -155,4 +220,4 @@ > > proc.time() user system elapsed - 1.392 0.152 3.531 + 1.480 0.176 1.791 Modified: trunk/SASxport/tests/testEmpty.Rout.save =================================================================== --- trunk/SASxport/tests/testEmpty.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/testEmpty.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -70,4 +71,4 @@ > > proc.time() user system elapsed - 1.344 0.120 1.715 + 1.332 0.136 1.949 Modified: trunk/SASxport/tests/testManyNames.Rout.save =================================================================== --- trunk/SASxport/tests/testManyNames.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/testManyNames.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -95,4 +96,4 @@ > > proc.time() user system elapsed - 19.368 0.216 20.394 + 19.200 0.208 19.802 Modified: trunk/SASxport/tests/testNegative.Rout.save =================================================================== --- trunk/SASxport/tests/testNegative.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/testNegative.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -48,4 +49,4 @@ > > proc.time() user system elapsed - 1.312 0.044 1.360 + 1.300 0.128 1.982 Modified: trunk/SASxport/tests/testNumeric.Rout.save =================================================================== --- trunk/SASxport/tests/testNumeric.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/testNumeric.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -87,4 +88,4 @@ > > proc.time() user system elapsed - 1.572 0.104 1.713 + 1.636 0.104 1.856 Modified: trunk/SASxport/tests/testUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/testUnnamedComponents.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -26,79 +27,143 @@ > ##tests > example(read.xport) -rd.xpr> # ------- -rd.xpr> # SAS code to generate test dataset: -rd.xpr> # ------- -rd.xpr> # libname y SASV5XPT "test2.xpt"; -rd.xpr> # -rd.xpr> # PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; -rd.xpr> # PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; -rd.xpr> # data test; -rd.xpr> # LENGTH race 3 age 4; -rd.xpr> # age=30; label age="Age at Beginning of Study"; -rd.xpr> # race=2; -rd.xpr> # d1='3mar2002'd ; -rd.xpr> # dt1='3mar2002 9:31:02'dt; -rd.xpr> # t1='11:13:45't; -rd.xpr> # output; -rd.xpr> # -rd.xpr> # age=31; -rd.xpr> # race=4; -rd.xpr> # d1='3jun2002'd ; -rd.xpr> # dt1='3jun2002 9:42:07'dt; -rd.xpr> # t1='11:14:13't; -rd.xpr> # output; -rd.xpr> # format d1 mmddyy10. dt1 datetime. t1 time. race race.; -rd.xpr> # run; -rd.xpr> # data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; -rd.xpr> # DO i=1 TO 100; -rd.xpr> # x3=ranuni(3); -rd.xpr> # x4=ranuni(5); -rd.xpr> # x5=ranuni(7); -rd.xpr> # x6=ranuni(9); -rd.xpr> # x7=ranuni(11); -rd.xpr> # x8=ranuni(13); -rd.xpr> # output; -rd.xpr> # END; -rd.xpr> # DROP i; -rd.xpr> # RUN; -rd.xpr> # PROC MEANS; RUN; -rd.xpr> # PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; -rd.xpr> # ------ +rd.xpr> ## ------- +rd.xpr> ## SAS code to generate test dataset: +rd.xpr> ## ------- +rd.xpr> ## libname y SASV5XPT "test2.xpt"; +rd.xpr> ## +rd.xpr> ## PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; +rd.xpr> ## PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; +rd.xpr> ## data test; +rd.xpr> ## LENGTH race 3 age 4; +rd.xpr> ## age=30; label age="Age at Beginning of Study"; +rd.xpr> ## race=2; +rd.xpr> ## d1='3mar2002'd ; +rd.xpr> ## dt1='3mar2002 9:31:02'dt; +rd.xpr> ## t1='11:13:45't; +rd.xpr> ## output; +rd.xpr> ## +rd.xpr> ## age=31; +rd.xpr> ## race=4; +rd.xpr> ## d1='3jun2002'd ; +rd.xpr> ## dt1='3jun2002 9:42:07'dt; +rd.xpr> ## t1='11:14:13't; +rd.xpr> ## output; +rd.xpr> ## format d1 mmddyy10. dt1 datetime. t1 time. race race.; +rd.xpr> ## run; +rd.xpr> ## data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; +rd.xpr> ## DO i=1 TO 100; +rd.xpr> ## x3=ranuni(3); +rd.xpr> ## x4=ranuni(5); +rd.xpr> ## x5=ranuni(7); +rd.xpr> ## x6=ranuni(9); +rd.xpr> ## x7=ranuni(11); +rd.xpr> ## x8=ranuni(13); +rd.xpr> ## output; +rd.xpr> ## END; +rd.xpr> ## DROP i; +rd.xpr> ## RUN; +rd.xpr> ## PROC MEANS; RUN; +rd.xpr> ## PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; +rd.xpr> ## ------ rd.xpr> -rd.xpr> # Read this dataset from a local file: +rd.xpr> ## Read this dataset from a local file: +rd.xpr> testFile <- system.file('extdata', 'test2.xpt', package="SASxport") + +rd.xpr> w <- read.xport(testFile) + +rd.xpr> class(w) +[1] "list" + +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 + + rd.xpr> ## Not run: -rd.xpr> ##D w <- read.xport('test2.xpt') +rd.xpr> ##D ## Or read a copy of test2.xpt available on the web: +rd.xpr> ##D url <- 'http://biostat.mc.vanderbilt.edu/wiki/pub/Main/Hmisc/test2.xpt' +rd.xpr> ##D w <- read.xport(url) rd.xpr> ## End(Not run) rd.xpr> -rd.xpr> # Or read a copy of test2.xpt available on the web: -rd.xpr> host <- 'http://biostat.mc.vanderbilt.edu' +rd.xpr> ## We can also get the dataset wrapped in a list +rd.xpr> w <- read.xport(testFile, as.list=TRUE) -rd.xpr> path <- '/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' +rd.xpr> class(w) +[1] "list" -rd.xpr> url <- paste(host,path,sep="") +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 -rd.xpr> w <- read.xport(url) +$z + X3 X4 X5 X6 X7 X8 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 -rd.xpr> # We can also get the dataset wrapped in a list -rd.xpr> w <- read.xport(url, as.list=TRUE) -rd.xpr> # And we can ask for the format information to be included as well. -rd.xpr> w <- read.xport(url, as.list=TRUE, include.formats=TRUE) +rd.xpr> ## And we can ask for the format information to be included as well. +rd.xpr> w <- read.xport(testFile, as.list=TRUE, include.formats=TRUE) +rd.xpr> class(w) +[1] "list" + +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 + +$FORMATS + FMTNAME START END LABEL MIN MAX DEFAULT LENGTH FUZZ +1 RACE 1 1 green 1 40 6 6 1e-12 +2 RACE 2 2 blue 1 40 6 6 1e-12 +3 RACE 3 3 purple 1 40 6 6 1e-12 + PREFIX MULT FILL NOEDIT TYPE SEXCL EEXCL HLO DECSEP DIG3SEP DATATYPE LANGUAGE +1 0 0 N N N +2 0 0 N N N +3 0 0 N N N + + rd.xpr> ## Don't show: -rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) +rd.xpr> stopifnot( is.data.frame(w)==FALSE && is.list(w)==TRUE ) rd.xpr> ## End Don't show rd.xpr> rd.xpr> rd.xpr> ## Not run: -rd.xpr> ##D ## The Hmisc library provides many useful functions for interacting with -rd.xpr> ##D ## data imported from SAS via read.xport() +rd.xpr> ##D #### The Hmisc library provides many useful functions for interacting with +rd.xpr> ##D #### data imported from SAS via read.xport() rd.xpr> ##D library(Hmisc) rd.xpr> ##D rd.xpr> ##D describe(w$test) # see labels, format names for dataset test -rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detaiil for each variable +rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detail for each variable rd.xpr> ##D rd.xpr> ##D contents(w$test) # another way to see variable attributes rd.xpr> ##D lapply(w, contents)# show contents of individual items in more detail @@ -1401,79 +1466,143 @@ > # Check with different list construction function *name* > example(read.xport) -rd.xpr> # ------- -rd.xpr> # SAS code to generate test dataset: -rd.xpr> # ------- -rd.xpr> # libname y SASV5XPT "test2.xpt"; -rd.xpr> # -rd.xpr> # PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; -rd.xpr> # PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; -rd.xpr> # data test; -rd.xpr> # LENGTH race 3 age 4; -rd.xpr> # age=30; label age="Age at Beginning of Study"; -rd.xpr> # race=2; -rd.xpr> # d1='3mar2002'd ; -rd.xpr> # dt1='3mar2002 9:31:02'dt; -rd.xpr> # t1='11:13:45't; -rd.xpr> # output; -rd.xpr> # -rd.xpr> # age=31; -rd.xpr> # race=4; -rd.xpr> # d1='3jun2002'd ; -rd.xpr> # dt1='3jun2002 9:42:07'dt; -rd.xpr> # t1='11:14:13't; -rd.xpr> # output; -rd.xpr> # format d1 mmddyy10. dt1 datetime. t1 time. race race.; -rd.xpr> # run; -rd.xpr> # data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; -rd.xpr> # DO i=1 TO 100; -rd.xpr> # x3=ranuni(3); -rd.xpr> # x4=ranuni(5); -rd.xpr> # x5=ranuni(7); -rd.xpr> # x6=ranuni(9); -rd.xpr> # x7=ranuni(11); -rd.xpr> # x8=ranuni(13); -rd.xpr> # output; -rd.xpr> # END; -rd.xpr> # DROP i; -rd.xpr> # RUN; -rd.xpr> # PROC MEANS; RUN; -rd.xpr> # PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; -rd.xpr> # ------ +rd.xpr> ## ------- +rd.xpr> ## SAS code to generate test dataset: +rd.xpr> ## ------- +rd.xpr> ## libname y SASV5XPT "test2.xpt"; +rd.xpr> ## +rd.xpr> ## PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; +rd.xpr> ## PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; +rd.xpr> ## data test; +rd.xpr> ## LENGTH race 3 age 4; +rd.xpr> ## age=30; label age="Age at Beginning of Study"; +rd.xpr> ## race=2; +rd.xpr> ## d1='3mar2002'd ; +rd.xpr> ## dt1='3mar2002 9:31:02'dt; +rd.xpr> ## t1='11:13:45't; +rd.xpr> ## output; +rd.xpr> ## +rd.xpr> ## age=31; +rd.xpr> ## race=4; +rd.xpr> ## d1='3jun2002'd ; +rd.xpr> ## dt1='3jun2002 9:42:07'dt; +rd.xpr> ## t1='11:14:13't; +rd.xpr> ## output; +rd.xpr> ## format d1 mmddyy10. dt1 datetime. t1 time. race race.; +rd.xpr> ## run; +rd.xpr> ## data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; +rd.xpr> ## DO i=1 TO 100; +rd.xpr> ## x3=ranuni(3); +rd.xpr> ## x4=ranuni(5); +rd.xpr> ## x5=ranuni(7); +rd.xpr> ## x6=ranuni(9); +rd.xpr> ## x7=ranuni(11); +rd.xpr> ## x8=ranuni(13); +rd.xpr> ## output; +rd.xpr> ## END; +rd.xpr> ## DROP i; +rd.xpr> ## RUN; +rd.xpr> ## PROC MEANS; RUN; +rd.xpr> ## PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; +rd.xpr> ## ------ rd.xpr> -rd.xpr> # Read this dataset from a local file: +rd.xpr> ## Read this dataset from a local file: +rd.xpr> testFile <- system.file('extdata', 'test2.xpt', package="SASxport") + +rd.xpr> w <- read.xport(testFile) + +rd.xpr> class(w) +[1] "list" + +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 + + rd.xpr> ## Not run: -rd.xpr> ##D w <- read.xport('test2.xpt') +rd.xpr> ##D ## Or read a copy of test2.xpt available on the web: +rd.xpr> ##D url <- 'http://biostat.mc.vanderbilt.edu/wiki/pub/Main/Hmisc/test2.xpt' +rd.xpr> ##D w <- read.xport(url) rd.xpr> ## End(Not run) rd.xpr> -rd.xpr> # Or read a copy of test2.xpt available on the web: -rd.xpr> host <- 'http://biostat.mc.vanderbilt.edu' +rd.xpr> ## We can also get the dataset wrapped in a list +rd.xpr> w <- read.xport(testFile, as.list=TRUE) -rd.xpr> path <- '/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' +rd.xpr> class(w) +[1] "list" -rd.xpr> url <- paste(host,path,sep="") +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 -rd.xpr> w <- read.xport(url) +$z + X3 X4 X5 X6 X7 X8 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 -rd.xpr> # We can also get the dataset wrapped in a list -rd.xpr> w <- read.xport(url, as.list=TRUE) -rd.xpr> # And we can ask for the format information to be included as well. -rd.xpr> w <- read.xport(url, as.list=TRUE, include.formats=TRUE) +rd.xpr> ## And we can ask for the format information to be included as well. +rd.xpr> w <- read.xport(testFile, as.list=TRUE, include.formats=TRUE) +rd.xpr> class(w) +[1] "list" + +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 + +$FORMATS + FMTNAME START END LABEL MIN MAX DEFAULT LENGTH FUZZ +1 RACE 1 1 green 1 40 6 6 1e-12 +2 RACE 2 2 blue 1 40 6 6 1e-12 +3 RACE 3 3 purple 1 40 6 6 1e-12 + PREFIX MULT FILL NOEDIT TYPE SEXCL EEXCL HLO DECSEP DIG3SEP DATATYPE LANGUAGE +1 0 0 N N N +2 0 0 N N N +3 0 0 N N N + + rd.xpr> ## Don't show: -rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) +rd.xpr> stopifnot( is.data.frame(w)==FALSE && is.list(w)==TRUE ) rd.xpr> ## End Don't show rd.xpr> rd.xpr> rd.xpr> ## Not run: -rd.xpr> ##D ## The Hmisc library provides many useful functions for interacting with -rd.xpr> ##D ## data imported from SAS via read.xport() +rd.xpr> ##D #### The Hmisc library provides many useful functions for interacting with +rd.xpr> ##D #### data imported from SAS via read.xport() rd.xpr> ##D library(Hmisc) rd.xpr> ##D rd.xpr> ##D describe(w$test) # see labels, format names for dataset test -rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detaiil for each variable +rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detail for each variable rd.xpr> ##D rd.xpr> ##D contents(w$test) # another way to see variable attributes rd.xpr> ##D lapply(w, contents)# show contents of individual items in more detail @@ -1639,79 +1768,143 @@ > # remove names > example(read.xport) -rd.xpr> # ------- -rd.xpr> # SAS code to generate test dataset: -rd.xpr> # ------- -rd.xpr> # libname y SASV5XPT "test2.xpt"; -rd.xpr> # -rd.xpr> # PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; -rd.xpr> # PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; -rd.xpr> # data test; -rd.xpr> # LENGTH race 3 age 4; -rd.xpr> # age=30; label age="Age at Beginning of Study"; -rd.xpr> # race=2; -rd.xpr> # d1='3mar2002'd ; -rd.xpr> # dt1='3mar2002 9:31:02'dt; -rd.xpr> # t1='11:13:45't; -rd.xpr> # output; -rd.xpr> # -rd.xpr> # age=31; -rd.xpr> # race=4; -rd.xpr> # d1='3jun2002'd ; -rd.xpr> # dt1='3jun2002 9:42:07'dt; -rd.xpr> # t1='11:14:13't; -rd.xpr> # output; -rd.xpr> # format d1 mmddyy10. dt1 datetime. t1 time. race race.; -rd.xpr> # run; -rd.xpr> # data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; -rd.xpr> # DO i=1 TO 100; -rd.xpr> # x3=ranuni(3); -rd.xpr> # x4=ranuni(5); -rd.xpr> # x5=ranuni(7); -rd.xpr> # x6=ranuni(9); -rd.xpr> # x7=ranuni(11); -rd.xpr> # x8=ranuni(13); -rd.xpr> # output; -rd.xpr> # END; -rd.xpr> # DROP i; -rd.xpr> # RUN; -rd.xpr> # PROC MEANS; RUN; -rd.xpr> # PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; -rd.xpr> # ------ +rd.xpr> ## ------- +rd.xpr> ## SAS code to generate test dataset: +rd.xpr> ## ------- +rd.xpr> ## libname y SASV5XPT "test2.xpt"; +rd.xpr> ## +rd.xpr> ## PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; +rd.xpr> ## PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; +rd.xpr> ## data test; +rd.xpr> ## LENGTH race 3 age 4; +rd.xpr> ## age=30; label age="Age at Beginning of Study"; +rd.xpr> ## race=2; +rd.xpr> ## d1='3mar2002'd ; +rd.xpr> ## dt1='3mar2002 9:31:02'dt; +rd.xpr> ## t1='11:13:45't; +rd.xpr> ## output; +rd.xpr> ## +rd.xpr> ## age=31; +rd.xpr> ## race=4; +rd.xpr> ## d1='3jun2002'd ; +rd.xpr> ## dt1='3jun2002 9:42:07'dt; +rd.xpr> ## t1='11:14:13't; +rd.xpr> ## output; +rd.xpr> ## format d1 mmddyy10. dt1 datetime. t1 time. race race.; +rd.xpr> ## run; +rd.xpr> ## data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; +rd.xpr> ## DO i=1 TO 100; +rd.xpr> ## x3=ranuni(3); +rd.xpr> ## x4=ranuni(5); +rd.xpr> ## x5=ranuni(7); +rd.xpr> ## x6=ranuni(9); +rd.xpr> ## x7=ranuni(11); +rd.xpr> ## x8=ranuni(13); +rd.xpr> ## output; +rd.xpr> ## END; +rd.xpr> ## DROP i; +rd.xpr> ## RUN; +rd.xpr> ## PROC MEANS; RUN; +rd.xpr> ## PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; +rd.xpr> ## ------ rd.xpr> -rd.xpr> # Read this dataset from a local file: +rd.xpr> ## Read this dataset from a local file: +rd.xpr> testFile <- system.file('extdata', 'test2.xpt', package="SASxport") + +rd.xpr> w <- read.xport(testFile) + +rd.xpr> class(w) +[1] "list" + +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 + + rd.xpr> ## Not run: -rd.xpr> ##D w <- read.xport('test2.xpt') +rd.xpr> ##D ## Or read a copy of test2.xpt available on the web: +rd.xpr> ##D url <- 'http://biostat.mc.vanderbilt.edu/wiki/pub/Main/Hmisc/test2.xpt' +rd.xpr> ##D w <- read.xport(url) rd.xpr> ## End(Not run) rd.xpr> -rd.xpr> # Or read a copy of test2.xpt available on the web: -rd.xpr> host <- 'http://biostat.mc.vanderbilt.edu' +rd.xpr> ## We can also get the dataset wrapped in a list +rd.xpr> w <- read.xport(testFile, as.list=TRUE) -rd.xpr> path <- '/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' +rd.xpr> class(w) +[1] "list" -rd.xpr> url <- paste(host,path,sep="") +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 -rd.xpr> w <- read.xport(url) +$z + X3 X4 X5 X6 X7 X8 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 -rd.xpr> # We can also get the dataset wrapped in a list -rd.xpr> w <- read.xport(url, as.list=TRUE) -rd.xpr> # And we can ask for the format information to be included as well. -rd.xpr> w <- read.xport(url, as.list=TRUE, include.formats=TRUE) +rd.xpr> ## And we can ask for the format information to be included as well. +rd.xpr> w <- read.xport(testFile, as.list=TRUE, include.formats=TRUE) +rd.xpr> class(w) +[1] "list" + +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 + +$FORMATS + FMTNAME START END LABEL MIN MAX DEFAULT LENGTH FUZZ +1 RACE 1 1 green 1 40 6 6 1e-12 +2 RACE 2 2 blue 1 40 6 6 1e-12 +3 RACE 3 3 purple 1 40 6 6 1e-12 + PREFIX MULT FILL NOEDIT TYPE SEXCL EEXCL HLO DECSEP DIG3SEP DATATYPE LANGUAGE +1 0 0 N N N +2 0 0 N N N +3 0 0 N N N + + rd.xpr> ## Don't show: -rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) +rd.xpr> stopifnot( is.data.frame(w)==FALSE && is.list(w)==TRUE ) rd.xpr> ## End Don't show rd.xpr> rd.xpr> rd.xpr> ## Not run: -rd.xpr> ##D ## The Hmisc library provides many useful functions for interacting with -rd.xpr> ##D ## data imported from SAS via read.xport() +rd.xpr> ##D #### The Hmisc library provides many useful functions for interacting with +rd.xpr> ##D #### data imported from SAS via read.xport() rd.xpr> ##D library(Hmisc) rd.xpr> ##D rd.xpr> ##D describe(w$test) # see labels, format names for dataset test -rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detaiil for each variable +rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detail for each variable rd.xpr> ##D rd.xpr> ##D contents(w$test) # another way to see variable attributes rd.xpr> ##D lapply(w, contents)# show contents of individual items in more detail @@ -1879,79 +2072,143 @@ > # remove variable names > example(read.xport) -rd.xpr> # ------- -rd.xpr> # SAS code to generate test dataset: -rd.xpr> # ------- -rd.xpr> # libname y SASV5XPT "test2.xpt"; -rd.xpr> # -rd.xpr> # PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; -rd.xpr> # PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; -rd.xpr> # data test; -rd.xpr> # LENGTH race 3 age 4; -rd.xpr> # age=30; label age="Age at Beginning of Study"; -rd.xpr> # race=2; -rd.xpr> # d1='3mar2002'd ; -rd.xpr> # dt1='3mar2002 9:31:02'dt; -rd.xpr> # t1='11:13:45't; -rd.xpr> # output; -rd.xpr> # -rd.xpr> # age=31; -rd.xpr> # race=4; -rd.xpr> # d1='3jun2002'd ; -rd.xpr> # dt1='3jun2002 9:42:07'dt; -rd.xpr> # t1='11:14:13't; -rd.xpr> # output; -rd.xpr> # format d1 mmddyy10. dt1 datetime. t1 time. race race.; -rd.xpr> # run; -rd.xpr> # data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; -rd.xpr> # DO i=1 TO 100; -rd.xpr> # x3=ranuni(3); -rd.xpr> # x4=ranuni(5); -rd.xpr> # x5=ranuni(7); -rd.xpr> # x6=ranuni(9); -rd.xpr> # x7=ranuni(11); -rd.xpr> # x8=ranuni(13); -rd.xpr> # output; -rd.xpr> # END; -rd.xpr> # DROP i; -rd.xpr> # RUN; -rd.xpr> # PROC MEANS; RUN; -rd.xpr> # PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; -rd.xpr> # ------ +rd.xpr> ## ------- +rd.xpr> ## SAS code to generate test dataset: +rd.xpr> ## ------- +rd.xpr> ## libname y SASV5XPT "test2.xpt"; +rd.xpr> ## +rd.xpr> ## PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; +rd.xpr> ## PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; +rd.xpr> ## data test; +rd.xpr> ## LENGTH race 3 age 4; +rd.xpr> ## age=30; label age="Age at Beginning of Study"; +rd.xpr> ## race=2; +rd.xpr> ## d1='3mar2002'd ; +rd.xpr> ## dt1='3mar2002 9:31:02'dt; +rd.xpr> ## t1='11:13:45't; +rd.xpr> ## output; +rd.xpr> ## +rd.xpr> ## age=31; +rd.xpr> ## race=4; +rd.xpr> ## d1='3jun2002'd ; +rd.xpr> ## dt1='3jun2002 9:42:07'dt; +rd.xpr> ## t1='11:14:13't; +rd.xpr> ## output; +rd.xpr> ## format d1 mmddyy10. dt1 datetime. t1 time. race race.; +rd.xpr> ## run; +rd.xpr> ## data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; +rd.xpr> ## DO i=1 TO 100; +rd.xpr> ## x3=ranuni(3); +rd.xpr> ## x4=ranuni(5); +rd.xpr> ## x5=ranuni(7); +rd.xpr> ## x6=ranuni(9); +rd.xpr> ## x7=ranuni(11); +rd.xpr> ## x8=ranuni(13); +rd.xpr> ## output; +rd.xpr> ## END; +rd.xpr> ## DROP i; +rd.xpr> ## RUN; +rd.xpr> ## PROC MEANS; RUN; +rd.xpr> ## PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; +rd.xpr> ## ------ rd.xpr> -rd.xpr> # Read this dataset from a local file: +rd.xpr> ## Read this dataset from a local file: +rd.xpr> testFile <- system.file('extdata', 'test2.xpt', package="SASxport") + +rd.xpr> w <- read.xport(testFile) + +rd.xpr> class(w) +[1] "list" + +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 + + rd.xpr> ## Not run: -rd.xpr> ##D w <- read.xport('test2.xpt') +rd.xpr> ##D ## Or read a copy of test2.xpt available on the web: +rd.xpr> ##D url <- 'http://biostat.mc.vanderbilt.edu/wiki/pub/Main/Hmisc/test2.xpt' +rd.xpr> ##D w <- read.xport(url) rd.xpr> ## End(Not run) rd.xpr> -rd.xpr> # Or read a copy of test2.xpt available on the web: -rd.xpr> host <- 'http://biostat.mc.vanderbilt.edu' +rd.xpr> ## We can also get the dataset wrapped in a list +rd.xpr> w <- read.xport(testFile, as.list=TRUE) -rd.xpr> path <- '/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' +rd.xpr> class(w) +[1] "list" -rd.xpr> url <- paste(host,path,sep="") +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 -rd.xpr> w <- read.xport(url) +$z + X3 X4 X5 X6 X7 X8 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 -rd.xpr> # We can also get the dataset wrapped in a list -rd.xpr> w <- read.xport(url, as.list=TRUE) -rd.xpr> # And we can ask for the format information to be included as well. -rd.xpr> w <- read.xport(url, as.list=TRUE, include.formats=TRUE) +rd.xpr> ## And we can ask for the format information to be included as well. +rd.xpr> w <- read.xport(testFile, as.list=TRUE, include.formats=TRUE) +rd.xpr> class(w) +[1] "list" + +rd.xpr> sapply(w, head) +$test + RACE AGE D1 DT1 T1 +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 +1 0.5548096 0.9102659 0.19947292 0.7781959 0.7648077 0.90783205 +2 0.6289062 0.5950751 0.14938208 0.1996997 0.4579557 0.57161156 +3 0.5601807 0.2015537 0.87107157 0.8915819 0.8178354 0.06978889 +4 0.9301758 0.6795225 0.06470965 0.2382916 0.6756623 0.86167683 +5 0.4273071 0.5349607 0.90357235 0.7710940 0.7477446 0.13104011 +6 0.1850586 0.5198102 0.79364078 0.7873601 0.7689810 0.89166854 + +$FORMATS + FMTNAME START END LABEL MIN MAX DEFAULT LENGTH FUZZ +1 RACE 1 1 green 1 40 6 6 1e-12 +2 RACE 2 2 blue 1 40 6 6 1e-12 +3 RACE 3 3 purple 1 40 6 6 1e-12 + PREFIX MULT FILL NOEDIT TYPE SEXCL EEXCL HLO DECSEP DIG3SEP DATATYPE LANGUAGE +1 0 0 N N N +2 0 0 N N N +3 0 0 N N N + + rd.xpr> ## Don't show: -rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) +rd.xpr> stopifnot( is.data.frame(w)==FALSE && is.list(w)==TRUE ) rd.xpr> ## End Don't show rd.xpr> rd.xpr> rd.xpr> ## Not run: -rd.xpr> ##D ## The Hmisc library provides many useful functions for interacting with -rd.xpr> ##D ## data imported from SAS via read.xport() +rd.xpr> ##D #### The Hmisc library provides many useful functions for interacting with +rd.xpr> ##D #### data imported from SAS via read.xport() rd.xpr> ##D library(Hmisc) rd.xpr> ##D rd.xpr> ##D describe(w$test) # see labels, format names for dataset test -rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detaiil for each variable +rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detail for each variable rd.xpr> ##D rd.xpr> ##D contents(w$test) # another way to see variable attributes rd.xpr> ##D lapply(w, contents)# show contents of individual items in more detail @@ -2163,4 +2420,4 @@ > > proc.time() user system elapsed - 6.192 1.760 17.901 + 6.172 1.968 9.155 Modified: trunk/SASxport/tests/test_as_is.Rout.save =================================================================== --- trunk/SASxport/tests/test_as_is.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/test_as_is.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -71,4 +72,4 @@ > > proc.time() user system elapsed - 0.884 0.076 0.963 + 0.924 0.104 1.071 Modified: trunk/SASxport/tests/test_fields.Rout.save =================================================================== --- trunk/SASxport/tests/test_fields.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/test_fields.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -32,4 +33,4 @@ > > proc.time() user system elapsed - 0.756 0.048 0.824 + 0.824 0.056 0.908 Modified: trunk/SASxport/tests/xport.Rout.save =================================================================== --- trunk/SASxport/tests/xport.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/xport.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -106,4 +107,4 @@ > q() > proc.time() user system elapsed - 0.904 0.100 1.013 + 0.932 0.152 1.164 Modified: trunk/SASxport/tests/xxx.Rout.save =================================================================== --- trunk/SASxport/tests/xxx.Rout.save 2013-10-09 18:20:23 UTC (rev 1720) +++ trunk/SASxport/tests/xxx.Rout.save 2013-10-09 18:25:07 UTC (rev 1721) @@ -16,8 +16,9 @@ Type 'q()' to quit R. > library(SASxport) +Loading required package: chron -Loaded SASxport version 1.3.5 (2013-06-14). +Loaded SASxport version 1.3.6 (2013-10-09). Type `?SASxport' for usage information. @@ -79,4 +80,4 @@ > > proc.time() user system elapsed - 0.912 0.112 1.021 + 0.948 0.100 1.147 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-09 18:20:26
|
Revision: 1720 http://sourceforge.net/p/r-gregmisc/code/1720 Author: warnes Date: 2013-10-09 18:20:23 +0000 (Wed, 09 Oct 2013) Log Message: ----------- Change to camelcase Modified Paths: -------------- trunk/SASxport/man/read.xport.Rd Modified: trunk/SASxport/man/read.xport.Rd =================================================================== --- trunk/SASxport/man/read.xport.Rd 2013-10-09 18:18:08 UTC (rev 1719) +++ trunk/SASxport/man/read.xport.Rd 2013-10-09 18:20:23 UTC (rev 1720) @@ -181,12 +181,12 @@ } ## We can also get the dataset wrapped in a list -w <- read.xport(testfile, as.list=TRUE) +w <- read.xport(testFile, as.list=TRUE) class(w) sapply(w, head) ## And we can ask for the format information to be included as well. -w <- read.xport(testfile, as.list=TRUE, include.formats=TRUE) +w <- read.xport(testFile, as.list=TRUE, include.formats=TRUE) class(w) sapply(w, head) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-09 18:18:11
|
Revision: 1719 http://sourceforge.net/p/r-gregmisc/code/1719 Author: warnes Date: 2013-10-09 18:18:08 +0000 (Wed, 09 Oct 2013) Log Message: ----------- Update for SASxport 1.3.6 release Modified Paths: -------------- trunk/SASxport/DESCRIPTION trunk/SASxport/inst/NEWS Modified: trunk/SASxport/DESCRIPTION =================================================================== --- trunk/SASxport/DESCRIPTION 2013-10-09 18:15:08 UTC (rev 1718) +++ trunk/SASxport/DESCRIPTION 2013-10-09 18:18:08 UTC (rev 1719) @@ -1,8 +1,8 @@ Package: SASxport Type: Package Title: Read and Write SAS XPORT Files -Version: 1.3.5 -Date: 2013-06-14 +Version: 1.3.6 +Date: 2013-10-09 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 @@ -38,6 +38,6 @@ <http://metruminstitute.org>. Maintainer: Gregory R. Warnes <gr...@wa...> License: GPL-2 -Depends: R (>= 2.4.0) +Depends: R (>= 2.4.0), chron Imports: chron URL: http://www.warnes.net, http://metruminstitute.org Modified: trunk/SASxport/inst/NEWS =================================================================== --- trunk/SASxport/inst/NEWS 2013-10-09 18:15:08 UTC (rev 1718) +++ trunk/SASxport/inst/NEWS 2013-10-09 18:18:08 UTC (rev 1719) @@ -1,3 +1,11 @@ +Version 1.3.6 2013-10-09 +------------------------ + +Bug fixes: + +- In manual pages for read.xport() and lookup.xporT(): Update URL for + 'test2.xpt', and use a local copy for executed example code. + Version 1.3.5 2013-06-14 ------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-09 18:15:11
|
Revision: 1718 http://sourceforge.net/p/r-gregmisc/code/1718 Author: warnes Date: 2013-10-09 18:15:08 +0000 (Wed, 09 Oct 2013) Log Message: ----------- Issue: URL test2.xpt file has moved. Solution: (1) Use local copy of file for executed examples, (2) update URL for displayed examples. Modified Paths: -------------- trunk/SASxport/man/lookup.xport.Rd trunk/SASxport/man/read.xport.Rd Modified: trunk/SASxport/man/lookup.xport.Rd =================================================================== --- trunk/SASxport/man/lookup.xport.Rd 2013-10-09 17:19:31 UTC (rev 1717) +++ trunk/SASxport/man/lookup.xport.Rd 2013-10-09 18:15:08 UTC (rev 1718) @@ -44,21 +44,21 @@ for \code{\link[foreign]{lookup.xport}}. } \examples{ -\dontshow{ -setwd(system.file("extdata", package="SASxport")) -} -## Get information on a local file -lookup.xport("Alfalfa.xpt") +## Get information about a local file +alfFile <- system.file('extdata', 'Alfalfa.xpt', package='SASxport') +lookup.xport(alfFile) -## Or read a copy of test2.xpt available on the web: +## Read a copy of test2.xpt available on the web: \dontrun{ -host <- 'http://biostat.mc.vanderbilt.edu' -path <- '/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' -url <- paste(host,path,sep="") - +url <- 'http://biostat.mc.vanderbilt.edu/wiki/pub/Main/Hmisc/test2.xpt' w <- lookup.xport(url) +} +## Or use the local copy... +testFile <- system.file('extdata', 'test2.xpt', package="SASxport") +w <- lookup.xport(testFile) + # display the information (calls 'print.lookup.xport') w @@ -74,7 +74,6 @@ # variable names within all data sets wS$name -} } \keyword{file} Modified: trunk/SASxport/man/read.xport.Rd =================================================================== --- trunk/SASxport/man/read.xport.Rd 2013-10-09 17:19:31 UTC (rev 1717) +++ trunk/SASxport/man/read.xport.Rd 2013-10-09 18:15:08 UTC (rev 1718) @@ -128,77 +128,80 @@ } \examples{ -# ------- -# SAS code to generate test dataset: -# ------- -# libname y SASV5XPT "test2.xpt"; -# -# PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; -# PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; -# data test; -# LENGTH race 3 age 4; -# age=30; label age="Age at Beginning of Study"; -# race=2; -# d1='3mar2002'd ; -# dt1='3mar2002 9:31:02'dt; -# t1='11:13:45't; -# output; -# -# age=31; -# race=4; -# d1='3jun2002'd ; -# dt1='3jun2002 9:42:07'dt; -# t1='11:14:13't; -# output; -# format d1 mmddyy10. dt1 datetime. t1 time. race race.; -# run; -# data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; -# DO i=1 TO 100; -# x3=ranuni(3); -# x4=ranuni(5); -# x5=ranuni(7); -# x6=ranuni(9); -# x7=ranuni(11); -# x8=ranuni(13); -# output; -# END; -# DROP i; -# RUN; -# PROC MEANS; RUN; -# PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; -# ------ +## ------- +## SAS code to generate test dataset: +## ------- +## libname y SASV5XPT "test2.xpt"; +## +## PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN; +## PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant; +## data test; +## LENGTH race 3 age 4; +## age=30; label age="Age at Beginning of Study"; +## race=2; +## d1='3mar2002'd ; +## dt1='3mar2002 9:31:02'dt; +## t1='11:13:45't; +## output; +## +## age=31; +## race=4; +## d1='3jun2002'd ; +## dt1='3jun2002 9:42:07'dt; +## t1='11:14:13't; +## output; +## format d1 mmddyy10. dt1 datetime. t1 time. race race.; +## run; +## data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8; +## DO i=1 TO 100; +## x3=ranuni(3); +## x4=ranuni(5); +## x5=ranuni(7); +## x6=ranuni(9); +## x7=ranuni(11); +## x8=ranuni(13); +## output; +## END; +## DROP i; +## RUN; +## PROC MEANS; RUN; +## PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt; +## ------ -# Read this dataset from a local file: +## Read this dataset from a local file: +testFile <- system.file('extdata', 'test2.xpt', package="SASxport") +w <- read.xport(testFile) +class(w) +sapply(w, head) + \dontrun{ -w <- read.xport('test2.xpt') +## Or read a copy of test2.xpt available on the web: +url <- 'http://biostat.mc.vanderbilt.edu/wiki/pub/Main/Hmisc/test2.xpt' +w <- read.xport(url) } -# Or read a copy of test2.xpt available on the web: -host <- 'http://biostat.mc.vanderbilt.edu' -path <- '/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' -url <- paste(host,path,sep="") +## We can also get the dataset wrapped in a list +w <- read.xport(testfile, as.list=TRUE) +class(w) +sapply(w, head) -w <- read.xport(url) +## And we can ask for the format information to be included as well. +w <- read.xport(testfile, as.list=TRUE, include.formats=TRUE) +class(w) +sapply(w, head) - -# We can also get the dataset wrapped in a list -w <- read.xport(url, as.list=TRUE) - -# And we can ask for the format information to be included as well. -w <- read.xport(url, as.list=TRUE, include.formats=TRUE) - \dontshow{ -SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) +stopifnot( is.data.frame(w)==FALSE && is.list(w)==TRUE ) } \dontrun{ -## The Hmisc library provides many useful functions for interacting with -## data imported from SAS via read.xport() +#### The Hmisc library provides many useful functions for interacting with +#### data imported from SAS via read.xport() library(Hmisc) describe(w$test) # see labels, format names for dataset test -lapply(w, describe)# see descriptive stats in more detaiil for each variable +lapply(w, describe)# see descriptive stats in more detail for each variable contents(w$test) # another way to see variable attributes lapply(w, contents)# show contents of individual items in more detail This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-09 17:19:34
|
Revision: 1717 http://sourceforge.net/p/r-gregmisc/code/1717 Author: warnes Date: 2013-10-09 17:19:31 +0000 (Wed, 09 Oct 2013) Log Message: ----------- Add local copy of test2.xpt SAS file Added Paths: ----------- trunk/SASxport/inst/extdata/test2.xpt Added: trunk/SASxport/inst/extdata/test2.xpt =================================================================== (Binary files differ) Index: trunk/SASxport/inst/extdata/test2.xpt =================================================================== --- trunk/SASxport/inst/extdata/test2.xpt 2013-09-23 15:46:43 UTC (rev 1716) +++ trunk/SASxport/inst/extdata/test2.xpt 2013-10-09 17:19:31 UTC (rev 1717) Property changes on: trunk/SASxport/inst/extdata/test2.xpt ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-09-23 15:46:47
|
Revision: 1716 http://sourceforge.net/p/r-gregmisc/code/1716 Author: warnes Date: 2013-09-23 15:46:43 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Comment out empty sections in gtools-deprecated.Rd Modified Paths: -------------- trunk/gtools/man/gtools-deprecated.Rd Modified: trunk/gtools/man/gtools-deprecated.Rd =================================================================== --- trunk/gtools/man/gtools-deprecated.Rd 2013-09-23 15:41:36 UTC (rev 1715) +++ trunk/gtools/man/gtools-deprecated.Rd 2013-09-23 15:46:43 UTC (rev 1716) @@ -5,10 +5,10 @@ These functions are provided for compatibility with older versions of gtools, and may be defunct as soon as the next release. } -\usage{ -} -\arguments{ -} +%\usage{ +%} +%\arguments{ +%} \details{ gtools currently contains no deprecated functions. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-09-23 15:41:40
|
Revision: 1715 http://sourceforge.net/p/r-gregmisc/code/1715 Author: warnes Date: 2013-09-23 15:41:36 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Update files for gtools 3.1.0 release Modified Paths: -------------- trunk/gtools/DESCRIPTION trunk/gtools/inst/NEWS Modified: trunk/gtools/DESCRIPTION =================================================================== --- trunk/gtools/DESCRIPTION 2013-09-23 15:37:21 UTC (rev 1714) +++ trunk/gtools/DESCRIPTION 2013-09-23 15:41:36 UTC (rev 1715) @@ -1,7 +1,7 @@ Package: gtools Title: Various R programming tools Description: Various R programming tools -Version: 3.0.1 +Version: 3.1.0 Date: 2013-09-22 Author: Gregory R. Warnes, Ben Bolker, and Thomas Lumley Maintainer: Gregory R. Warnes <gr...@wa...> Modified: trunk/gtools/inst/NEWS =================================================================== --- trunk/gtools/inst/NEWS 2013-09-23 15:37:21 UTC (rev 1714) +++ trunk/gtools/inst/NEWS 2013-09-23 15:41:36 UTC (rev 1715) @@ -1,6 +1,11 @@ -gtools 3.0.1 - 2013-09-22 +gtools 3.1.0 - 2013-09-22 ------------------------- +Major changes: + +- The function 'addLast()' (deprecated since gtools 3.0.0) is no + longer available, and has been marked defunct. + Bug fixes: - Modified 'mixedorder()' to use Use 'suppressWarnings() instead of @@ -8,6 +13,7 @@ called from within a nested environment, such as when run from within 'knitr' + gtools 3.0.0 - 2013-07-06 ------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-09-23 15:37:24
|
Revision: 1714 http://sourceforge.net/p/r-gregmisc/code/1714 Author: warnes Date: 2013-09-23 15:37:21 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Make 'addLast()' defunct. Modified Paths: -------------- trunk/gtools/man/gtools-defunct.Rd trunk/gtools/man/gtools-deprecated.Rd trunk/gtools/man/lastAdd.Rd Removed Paths: ------------- trunk/gtools/man/addLast-deprecated.Rd Deleted: trunk/gtools/man/addLast-deprecated.Rd =================================================================== --- trunk/gtools/man/addLast-deprecated.Rd 2013-09-23 15:29:26 UTC (rev 1713) +++ trunk/gtools/man/addLast-deprecated.Rd 2013-09-23 15:37:21 UTC (rev 1714) @@ -1,78 +0,0 @@ -\name{addLast-deprecated} -\alias{addLast-deprecated} -\title{Add a function to be executed when R exits.} -\description{ - Add a function to be executed when R exits. -} -\usage{ -addLast(fun) -} -\arguments{ - \item{fun}{Function to be called.} -} -\details{ - \code{addLast} defines the \code{.Last} function in the global - environment (if not already present) or redifines it so that the - function \code{fun} will be called when R exits. The latter is - accomplished by saving the current definition of \code{.Last} and - creating a new \code{.Last} function that calls \code{fun} and then - the original \code{.Last} function. -} -\value{ - None. -} -\note{This function has been deprecated in favor of \code{lastAdd} - because it creates/modifies the definition of '.Last' in the - global environment, which is expressly disallowed by the CRAN - policies. } -\author{Gregory R. Warnes \email{gr...@wa...}} -\seealso{ - \code{\link[base]{.Last}}, - \code{\link[gtools]{lastAdd}} -} -\examples{ - -## Print a couple of cute messages when R exits. -helloWorld <- function() cat("\nHello World!\n") -byeWorld <- function() cat("\nGoodbye World!\n") - -addLast(byeWorld) -addLast(helloWorld) - -\dontrun{ -q("no") - -## Should yield: -## -## Save workspace image? [y/n/c]: n -## -## Hello World! -## -## Goodbye World! -## -## Process R finished at Tue Nov 22 10:28:55 2005 -} - -## Unix-flavour example: send Rplots.ps to printer on exit. -myLast <- function() -{ - cat("Now sending PostScript graphics to the printer:\n") - system("lpr Rplots.ps") - cat("bye bye...\n") -} -addLast(myLast) -\dontrun{ -quit("yes") - -## Should yield: -## -## Now sending PostScript graphics to the printer: -## lpr: job 1341 queued -## bye bye... -## -## Process R finished at Tue Nov 22 10:28:55 2005 -} - -} -\keyword{programming} - Modified: trunk/gtools/man/gtools-defunct.Rd =================================================================== --- trunk/gtools/man/gtools-defunct.Rd 2013-09-23 15:29:26 UTC (rev 1713) +++ trunk/gtools/man/gtools-defunct.Rd 2013-09-23 15:37:21 UTC (rev 1714) @@ -1,20 +1,30 @@ \name{gtools-defunct} \alias{gtools-defunct} \alias{assert} +\alias{addLast} \title{Deprecated Functions in the gtools package} \description{ These functions are no longer available in gtools. } \usage{ assert(FLAG) +addLast(fun) } \arguments{ \item{FLAG}{ Expression that should evaluate to a boolean vector} + \item{fun}{Function to be called.} } \details{ - \code{assert} is a defunct synonym for \code{\link[base]{stopifnot}}. + \itemize{ + \item{ \code{assert} is a defunct synonym for + \code{\link[base]{stopifnot}}. } + \item{ \code{addLast} has been replaced by \code{lastAdd}, which has + the same purpose but appled using different syntax. } + } } \seealso{ - \code{\link{Defunct}} + \code{\link[base]{Defunct}} + \code{\link[base]{stopifnot}} + \code{\link[gtools]{lastAdd}} } \keyword{misc} Modified: trunk/gtools/man/gtools-deprecated.Rd =================================================================== --- trunk/gtools/man/gtools-deprecated.Rd 2013-09-23 15:29:26 UTC (rev 1713) +++ trunk/gtools/man/gtools-deprecated.Rd 2013-09-23 15:37:21 UTC (rev 1714) @@ -1,29 +1,26 @@ \name{gtools-deprecated} \alias{gtools-deprecated} -\alias{addLast} \title{Deprecated Functions in the gtools package} \description{ These functions are provided for compatibility with older versions of gtools, and may be defunct as soon as the next release. } \usage{ -addLast(fun) } \arguments{ - \item{fun}{Function to be called.} } \details{ - The original help page for these functions is often - available at \code{help("oldName-deprecated")} (note the quotes). - - \itemize{ - \item{ \code{addLast} has been replaced by \code{lastAdd}, which has - the same purpose but appled using different syntax. } - } + gtools currently contains no deprecated functions. + +% The original help page for these functions is often +% available at \code{help("oldName-deprecated")} (note the quotes). +% +% \itemize{ +% \item{} +% } } \seealso{ \code{\link{Deprecated}} - \code{\link[gtools]{lastAdd}} } \keyword{misc} Modified: trunk/gtools/man/lastAdd.Rd =================================================================== --- trunk/gtools/man/lastAdd.Rd 2013-09-23 15:29:26 UTC (rev 1713) +++ trunk/gtools/man/lastAdd.Rd 2013-09-23 15:37:21 UTC (rev 1714) @@ -25,7 +25,7 @@ } \note{ - This function replaces the (now deprecated) \code{addLast} function. + This function replaces the (now defunct) \code{addLast} function. } \value{ A new function to be used for \code{.Last}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-09-23 15:29:29
|
Revision: 1713 http://sourceforge.net/p/r-gregmisc/code/1713 Author: warnes Date: 2013-09-23 15:29:26 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Mark 'addLast()' as defunct and move 'lastAdd()' function to a separate file. Modified Paths: -------------- trunk/gtools/R/addLast.R Added Paths: ----------- trunk/gtools/R/lastAdd.R Modified: trunk/gtools/R/addLast.R =================================================================== --- trunk/gtools/R/addLast.R 2013-09-23 15:23:34 UTC (rev 1712) +++ trunk/gtools/R/addLast.R 2013-09-23 15:29:26 UTC (rev 1713) @@ -1,39 +1,4 @@ addLast <- function( fun ) - { - .Deprecated(new=paste(".Last <- lastAdd(", deparse(substitute(fun)), ")", sep=''), - package='gtools' - ) - - if (!is.function(fun)) stop("fun must be a function") - if (!exists(".Last", envir = .GlobalEnv)) - assign(".Last", fun, envir = .GlobalEnv) - else - { - Last <- get(".Last", envir = .GlobalEnv) - newfun <- function(...) { - fun() - Last() - } - assign(".Last", newfun, envir = .GlobalEnv) - } - } - -lastAdd <- function( fun ) - { - if (!is.function(fun)) stop("fun must be a function") - if(!exists(".Last", envir=.GlobalEnv)) - { - return(fun) - } - else - { - Last <- get(".Last", envir=.GlobalEnv) - newfun <- function(...) - { - fun() - Last() - } - return(newfun) - } - } - + .Defunct(new=paste(".Last <- lastAdd(", deparse(substitute(fun)), ")", sep=''), + package='gtools' + ) Added: trunk/gtools/R/lastAdd.R =================================================================== --- trunk/gtools/R/lastAdd.R (rev 0) +++ trunk/gtools/R/lastAdd.R 2013-09-23 15:29:26 UTC (rev 1713) @@ -0,0 +1,22 @@ +## +## Replaces the (defunct) addLast() function. +## +lastAdd <- function( fun ) + { + if (!is.function(fun)) stop("fun must be a function") + if(!exists(".Last", envir=.GlobalEnv)) + { + return(fun) + } + else + { + Last <- get(".Last", envir=.GlobalEnv) + newfun <- function(...) + { + fun() + Last() + } + return(newfun) + } + } + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-09-23 15:23:37
|
Revision: 1712 http://sourceforge.net/p/r-gregmisc/code/1712 Author: warnes Date: 2013-09-23 15:23:34 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Update for gtools 3.0.1 release Modified Paths: -------------- trunk/gtools/DESCRIPTION trunk/gtools/inst/NEWS Modified: trunk/gtools/DESCRIPTION =================================================================== --- trunk/gtools/DESCRIPTION 2013-09-23 15:19:06 UTC (rev 1711) +++ trunk/gtools/DESCRIPTION 2013-09-23 15:23:34 UTC (rev 1712) @@ -1,8 +1,8 @@ Package: gtools Title: Various R programming tools Description: Various R programming tools -Version: 3.0.0 -Date: 2013-07-06 +Version: 3.0.1 +Date: 2013-09-22 Author: Gregory R. Warnes, Ben Bolker, and Thomas Lumley Maintainer: Gregory R. Warnes <gr...@wa...> License: LGPL-2.1 Modified: trunk/gtools/inst/NEWS =================================================================== --- trunk/gtools/inst/NEWS 2013-09-23 15:19:06 UTC (rev 1711) +++ trunk/gtools/inst/NEWS 2013-09-23 15:23:34 UTC (rev 1712) @@ -1,3 +1,13 @@ +gtools 3.0.1 - 2013-09-22 +------------------------- + +Bug fixes: + +- Modified 'mixedorder()' to use Use 'suppressWarnings() instead of + 'options(warn=-1)'. This will avoid egregious warning messages when + called from within a nested environment, such as when run from + within 'knitr' + gtools 3.0.0 - 2013-07-06 ------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-09-23 15:19:09
|
Revision: 1711 http://sourceforge.net/p/r-gregmisc/code/1711 Author: warnes Date: 2013-09-23 15:19:06 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Use 'suppressWarnings() instead of 'options(warn=-1)' in 'mixedorder()'. Modified Paths: -------------- trunk/gtools/R/mixedsort.R Modified: trunk/gtools/R/mixedsort.R =================================================================== --- trunk/gtools/R/mixedsort.R 2013-07-18 14:09:14 UTC (rev 1710) +++ trunk/gtools/R/mixedsort.R 2013-09-23 15:19:06 UTC (rev 1711) @@ -13,19 +13,12 @@ numeric <- function(x) { - optwarn = options("warn") - on.exit( options(optwarn) ) - options(warn=-1) - as.numeric(x) + suppressWarnings( as.numeric(x) ) } nonnumeric <- function(x) { - optwarn = options("warn") - on.exit( options(optwarn) ) - options(warn=-1) - - ifelse(is.na(as.numeric(x)), toupper(x), NA) + suppressWarnings( ifelse(is.na(as.numeric(x)), toupper(x), NA) ) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Charles S. <cst...@ch...> - 2013-08-03 03:58:04
|
Hello, So I want to prettify my crosstables output a bit. I tried to create an object that holds the table itself: ct <- CrossTable(es$Q4_fac, mydata$time, prop.t = FALSE, prop.r = TRUE, prop.c = FALSE, prop.chisq = FALSE) #, format = c("SPSS")) ..thinking that I could change the attributes and then print, but when I try to display the table: >ct I don't get the table. Thanks in advance. |
From: <wa...@us...> - 2013-07-18 14:09:17
|
Revision: 1710 http://sourceforge.net/p/r-gregmisc/code/1710 Author: warnes Date: 2013-07-18 14:09:14 +0000 (Thu, 18 Jul 2013) Log Message: ----------- Looks like Brian Ripley repackaged for R 3.0.0 and bumped version number, so change it to 2.15.5 Modified Paths: -------------- trunk/gmodels/DESCRIPTION trunk/gmodels/inst/NEWS Modified: trunk/gmodels/DESCRIPTION =================================================================== --- trunk/gmodels/DESCRIPTION 2013-07-18 13:57:26 UTC (rev 1709) +++ trunk/gmodels/DESCRIPTION 2013-07-18 14:09:14 UTC (rev 1710) @@ -1,5 +1,5 @@ Package: gmodels -Version: 2.15.4 +Version: 2.15.5 Date: 2013-07-18 Title: Various R programming tools for model fitting Author: Gregory R. Warnes, Ben Bolker, Thomas Lumley, and Randall C @@ -13,6 +13,5 @@ Suggests: gplots, gtools, Matrix, nlme, lme4 (>= 0.999999-0) Imports: MASS, gdata License: GPL-2 -URL: http://cran.r-project.org/src/contrib/PACKAGES.html - http://www.sf.net/projects/r-gregmisc - +URL: http://www.sf.net/projects/r-gregmisc +NeedsCompilation: no Modified: trunk/gmodels/inst/NEWS =================================================================== --- trunk/gmodels/inst/NEWS 2013-07-18 13:57:26 UTC (rev 1709) +++ trunk/gmodels/inst/NEWS 2013-07-18 14:09:14 UTC (rev 1710) @@ -1,4 +1,4 @@ -Version 2.15.4 - 2013-07-18 +Version 2.15.5 - 2013-07-18 --------------------------- Bug fixes: @@ -9,8 +9,8 @@ Other Changes: - Update man page file for ci() to current Rd syntax. +- Remove unused argument to ci.mer() - Version 2.15.3 - 2012-06-27 --------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-18 13:57:29
|
Revision: 1709 http://sourceforge.net/p/r-gregmisc/code/1709 Author: warnes Date: 2013-07-18 13:57:26 +0000 (Thu, 18 Jul 2013) Log Message: ----------- Update for gmodels 2.15.4 Modified Paths: -------------- trunk/gmodels/DESCRIPTION trunk/gmodels/inst/NEWS Modified: trunk/gmodels/DESCRIPTION =================================================================== --- trunk/gmodels/DESCRIPTION 2013-07-18 13:54:31 UTC (rev 1708) +++ trunk/gmodels/DESCRIPTION 2013-07-18 13:57:26 UTC (rev 1709) @@ -1,9 +1,8 @@ Package: gmodels -Version: 2.15.3 -Date: 2012-06-27 +Version: 2.15.4 +Date: 2013-07-18 Title: Various R programming tools for model fitting -Author: Gregory R. Warnes. Includes R source code and/or documentation - contributed by Ben Bolker, Thomas Lumley, and Randall C +Author: Gregory R. Warnes, Ben Bolker, Thomas Lumley, and Randall C Johnson. Contributions from Randall C. Johnson are Copyright (2005) SAIC-Frederick, Inc. Funded by the Intramural Research Program, of the NIH, National Cancer Institute, Center for Modified: trunk/gmodels/inst/NEWS =================================================================== --- trunk/gmodels/inst/NEWS 2013-07-18 13:54:31 UTC (rev 1708) +++ trunk/gmodels/inst/NEWS 2013-07-18 13:57:26 UTC (rev 1709) @@ -1,3 +1,16 @@ +Version 2.15.4 - 2013-07-18 +--------------------------- + +Bug fixes: + +- Correct error in estimable.mlm() that caused it to always fail. Added + test code to prevent future issues. + +Other Changes: + +- Update man page file for ci() to current Rd syntax. + + Version 2.15.3 - 2012-06-27 --------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-18 13:54:35
|
Revision: 1708 http://sourceforge.net/p/r-gregmisc/code/1708 Author: warnes Date: 2013-07-18 13:54:31 +0000 (Thu, 18 Jul 2013) Log Message: ----------- Update to current Rd syntax Modified Paths: -------------- trunk/gmodels/man/ci.Rd Modified: trunk/gmodels/man/ci.Rd =================================================================== --- trunk/gmodels/man/ci.Rd 2013-07-18 13:46:00 UTC (rev 1707) +++ trunk/gmodels/man/ci.Rd 2013-07-18 13:54:31 UTC (rev 1708) @@ -13,9 +13,9 @@ \code{ci.default}, the probability of a binomial vector \code{ci.binom}, and for \code{lm}, \code{lme}, and \code{mer} objects are provided. } -\synopsis{ +\usage{ ci(x, confidence = 0.95, alpha = 1 - confidence,...) - \method{ci}{default}(x, confidence = 0.95, alpha = 1 - confidence, na.rm=FALSE)...) + \method{ci}{default}(x, confidence = 0.95, alpha = 1 - confidence, na.rm=FALSE, ...) \method{ci}{binom}(x, confidence = 0.95, alpha = 1 - confidence,...) \method{ci}{lm}(x, confidence = 0.95, alpha = 1 - confidence,...) \method{ci}{lme}(x, confidence = 0.95, alpha = 1 - confidence,...) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-18 13:46:04
|
Revision: 1707 http://sourceforge.net/p/r-gregmisc/code/1707 Author: warnes Date: 2013-07-18 13:46:00 +0000 (Thu, 18 Jul 2013) Log Message: ----------- Correct bug in estimable.mlm Modified Paths: -------------- trunk/gmodels/R/estimable.mlm.R Added Paths: ----------- trunk/gmodels/test/test_estimable_mlm.R Modified: trunk/gmodels/R/estimable.mlm.R =================================================================== --- trunk/gmodels/R/estimable.mlm.R 2013-07-15 18:13:11 UTC (rev 1706) +++ trunk/gmodels/R/estimable.mlm.R 2013-07-18 13:46:00 UTC (rev 1707) @@ -1,28 +1,28 @@ `estimable.mlm` <- function (obj, cm, beta0, conf.int=NULL, show.beta0, ...) { - coef <- coef(object) + coef <- coef(obj) ny <- ncol(coef) - effects <- object$effects - resid <- object$residuals - fitted <- object$fitted + effects <- obj$effects + resid <- obj$residuals + fitted <- obj$fitted ynames <- colnames(coef) if (is.null(ynames)) { - lhs <- object$terms[[2]] + lhs <- obj$terms[[2]] if (mode(lhs) == "call" && lhs[[1]] == "cbind") ynames <- as.character(lhs)[-1] else ynames <- paste("Y", seq(ny), sep = "") } value <- vector("list", ny) names(value) <- paste("Response", ynames) - cl <- oldClass(object) - class(object) <- cl[match("mlm", cl):length(cl)][-1] + cl <- oldClass(obj) + class(obj) <- cl[match("mlm", cl):length(cl)][-1] for (i in seq(ny)) { - object$coefficients <- coef[, i] - object$residuals <- resid[, i] - object$fitted.values <- fitted[, i] - object$effects <- effects[, i] - object$call$formula[[2]] <- object$terms[[2]] <- as.name(ynames[i]) + obj$coefficients <- coef[, i] + obj$residuals <- resid[, i] + obj$fitted.values <- fitted[, i] + obj$effects <- effects[, i] + obj$call$formula[[2]] <- obj$terms[[2]] <- as.name(ynames[i]) value[[i]] <- estimable(obj, cm, beta0, conf.int=NULL, show.beta0, ...) } class(value) <- "listof" Added: trunk/gmodels/test/test_estimable_mlm.R =================================================================== --- trunk/gmodels/test/test_estimable_mlm.R (rev 0) +++ trunk/gmodels/test/test_estimable_mlm.R 2013-07-18 13:46:00 UTC (rev 1707) @@ -0,0 +1,15 @@ +library(gmodels) + +y <- cbind(rnorm(100), rnorm(100)) + +x1 <- rnorm(100) +x2 <- rnorm(100) + +cm <- t(matrix(c(0, 1,-1))) +lm.1 <- lm(y ~ x1 + x2) + +estimable(lm.1, cm) + +## >> Error in coef(object) : object 'object' not found + +gmodels:::estimable.mlm(lm.1, cm) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-15 18:13:15
|
Revision: 1706 http://sourceforge.net/p/r-gregmisc/code/1706 Author: warnes Date: 2013-07-15 18:13:11 +0000 (Mon, 15 Jul 2013) Log Message: ----------- Remove unused argument to ci.mer Modified Paths: -------------- trunk/gmodels/R/ci.R trunk/gmodels/man/ci.Rd Modified: trunk/gmodels/R/ci.R =================================================================== --- trunk/gmodels/R/ci.R 2013-07-07 00:11:06 UTC (rev 1705) +++ trunk/gmodels/R/ci.R 2013-07-15 18:13:11 UTC (rev 1706) @@ -71,7 +71,6 @@ ci.mer <- function (x, confidence = 0.95, alpha = 1 - confidence, - sim.mer = TRUE, n.sim = 1e4, ...) { Modified: trunk/gmodels/man/ci.Rd =================================================================== --- trunk/gmodels/man/ci.Rd 2013-07-07 00:11:06 UTC (rev 1705) +++ trunk/gmodels/man/ci.Rd 2013-07-15 18:13:11 UTC (rev 1706) @@ -19,8 +19,7 @@ \method{ci}{binom}(x, confidence = 0.95, alpha = 1 - confidence,...) \method{ci}{lm}(x, confidence = 0.95, alpha = 1 - confidence,...) \method{ci}{lme}(x, confidence = 0.95, alpha = 1 - confidence,...) - \method{ci}{mer}(x, confidence = 0.95, alpha = 1 - confidence, - sim.mer=TRUE, n.sim=10000, ...) + \method{ci}{mer}(x, confidence = 0.95, alpha = 1 - confidence, n.sim=10000, ...) } \arguments{ \item{x}{ object from which to compute confidence intervals. } @@ -29,9 +28,6 @@ \item{na.rm}{boolean indicating whether missing values should be removed. Defaults to \code{FALSE}.} \item{\dots}{Arguments for methods} - \item{sim.mer}{Logical value. If TRUE confidence - intervals will be estimated using \code{mcmcsamp}. This option only takes effect for mer - objects.} \item{n.sim}{Number of samples to take in \code{mcmcsamp}.} } %\details{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-07 00:11:09
|
Revision: 1705 http://sourceforge.net/p/r-gregmisc/code/1705 Author: warnes Date: 2013-07-07 00:11:06 +0000 (Sun, 07 Jul 2013) Log Message: ----------- Fix typo. Modified Paths: -------------- trunk/gtools/man/lastAdd.Rd Modified: trunk/gtools/man/lastAdd.Rd =================================================================== --- trunk/gtools/man/lastAdd.Rd 2013-07-06 23:55:54 UTC (rev 1704) +++ trunk/gtools/man/lastAdd.Rd 2013-07-07 00:11:06 UTC (rev 1705) @@ -5,7 +5,7 @@ Non-destructively construct a \code{.Last} function to be executed when R exits. } \usage{ -addLast(fun) +lastAdd(fun) } \arguments{ \item{fun}{Function to be called.} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-06 23:55:57
|
Revision: 1704 http://sourceforge.net/p/r-gregmisc/code/1704 Author: warnes Date: 2013-07-06 23:55:54 +0000 (Sat, 06 Jul 2013) Log Message: ----------- Fix Rd warning. Modified Paths: -------------- trunk/gtools/man/lastAdd.Rd Modified: trunk/gtools/man/lastAdd.Rd =================================================================== --- trunk/gtools/man/lastAdd.Rd 2013-07-06 23:49:26 UTC (rev 1703) +++ trunk/gtools/man/lastAdd.Rd 2013-07-06 23:55:54 UTC (rev 1704) @@ -5,14 +5,14 @@ Non-destructively construct a \code{.Last} function to be executed when R exits. } \usage{ -.Last <- addLast(fun) +addLast(fun) } \arguments{ \item{fun}{Function to be called.} } \details{ - \code{lastAdd} constructs a new function to be used to replace the - exising definition of \code{.Last}, which will be executed when R + \code{lastAdd} constructs a new function which can be used to replace + the exising definition of \code{.Last}, which will be executed when R terminates normally. If a \code{.Last} function already exists in the global environment, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-06 23:49:28
|
Revision: 1703 http://sourceforge.net/p/r-gregmisc/code/1703 Author: warnes Date: 2013-07-06 23:49:26 +0000 (Sat, 06 Jul 2013) Log Message: ----------- Include lastAdd in NAMESPACE Modified Paths: -------------- trunk/gtools/NAMESPACE Modified: trunk/gtools/NAMESPACE =================================================================== --- trunk/gtools/NAMESPACE 2013-07-06 23:46:26 UTC (rev 1702) +++ trunk/gtools/NAMESPACE 2013-07-06 23:49:26 UTC (rev 1703) @@ -16,6 +16,7 @@ inv.logit, invalid, keywords, + lastAdd, logit, logratio2foldchange, mixedorder, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |