[R-gregmisc-users] SF.net SVN: r-gregmisc:[1651] trunk/SASxport/tests
Brought to you by:
warnes
From: <wa...@us...> - 2013-05-11 20:05:59
|
Revision: 1651 http://sourceforge.net/p/r-gregmisc/code/1651 Author: warnes Date: 2013-05-11 20:05:57 +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. Added Paths: ----------- trunk/SASxport/tests/events.csv trunk/SASxport/tests/exposure.csv trunk/SASxport/tests/testBlockBoundary.R Added: trunk/SASxport/tests/events.csv =================================================================== --- trunk/SASxport/tests/events.csv (rev 0) +++ trunk/SASxport/tests/events.csv 2013-05-11 20:05:57 UTC (rev 1651) @@ -0,0 +1,11 @@ +"NID","TIME","DINTV","EVID","AUC","CMAX","TMAX","RT","CMIN","IPRED","CWRES","DV","PRED","RES","WRES" +1,0,1,1,0,-1,-1,-1,9999,0,0,0,0,0,0 +1,1,1,0,7.8964,14.918,1,1,14.918,14.918,-3.0776,5.24,24.54,-19.3,-3.3211 +1,2,1,2,22.436,15.298,1.2179,1.2179,12.845,12.845,0,0,14.455,0,0 +1,3,1,2,32.934,15.298,1.2179,1.2179,8.2815,8.2815,0,0,9.0077,0,0 +1,4,1,2,39.464,15.298,1.2179,1.2179,5.0233,5.0233,0,0,5.9024,0,0 +1,5,1,2,43.403,15.298,1.2179,1.2179,3.0246,3.0246,0,0,4.0132,0,0 +1,6,1,2,45.78,15.298,1.2179,1.2179,1.8323,1.8323,0,0,2.7974,0,0 +1,7,1,2,47.224,15.298,1.2179,1.2179,1.1164,1.1164,0,0,1.9773,0,0 +1,8,1,2,48.105,15.298,1.2179,1.2179,0.68056,0.68057,0,0,1.4036,0,0 +1,9,1,2,48.641,15.298,1.2179,1.2179,0.41253,0.41253,0,0,0.99249,0,0 Added: trunk/SASxport/tests/exposure.csv =================================================================== --- trunk/SASxport/tests/exposure.csv (rev 0) +++ trunk/SASxport/tests/exposure.csv 2013-05-11 20:05:57 UTC (rev 1651) @@ -0,0 +1,2 @@ +"NID","DINTV","CMAX","TMAX","CMIN","AUC" +NA,NA,NA,NA,NA,NA Added: trunk/SASxport/tests/testBlockBoundary.R =================================================================== --- trunk/SASxport/tests/testBlockBoundary.R (rev 0) +++ trunk/SASxport/tests/testBlockBoundary.R 2013-05-11 20:05:57 UTC (rev 1651) @@ -0,0 +1,33 @@ +## This script tests an edge case where a dataset ends exactly on a +## block boundery. Previously, this could lead to an error in +## loading the created data file. + +library(SASxport) +events <- read.csv('events.csv') +exposure <- read.csv('exposure.csv') +events +exposure + + +write.xport(events,exposure,file='dat.xpt') +write.xport(exposure,events,file='tad.xpt') + +l1.s <- SASxport::lookup.xport('dat.xpt') +l2.s <- SASxport::lookup.xport('tad.xpt') + +stopifnot( identical( l1.s$EXPOSURE, l2.s$EXPOSURE) ) +stopifnot( identical( l1.s$EVENTS, l2.s$EVENTS ) ) + +d1.s <- SASxport::read.xport(file='dat.xpt') +d2.s <- SASxport::read.xport(file='tad.xpt') + +stopifnot( identical( d1.s$EXPOSURE, d2.s$EXPOSURE) ) +stopifnot( identical( d1.s$EVENTS, d2.s$EVENTS) ) + + + + + + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |