[R-gregmisc-users] SF.net SVN: r-gregmisc: [1167] trunk/SASxport/tests
Brought to you by:
warnes
From: <wa...@us...> - 2007-09-07 16:48:22
|
Revision: 1167 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1167&view=rev Author: warnes Date: 2007-09-07 09:47:08 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Add round-trip test for Theoph data set Added Paths: ----------- trunk/SASxport/tests/Theoph.R trunk/SASxport/tests/Theoph.Rout.save Added: trunk/SASxport/tests/Theoph.R =================================================================== --- trunk/SASxport/tests/Theoph.R (rev 0) +++ trunk/SASxport/tests/Theoph.R 2007-09-07 16:47:08 UTC (rev 1167) @@ -0,0 +1,19 @@ + +#### +## Round-trip test on Theoph data +#### + +library(SASxport) + +write.xport(Theoph,file="theoph.xpt") +Theoph.2 <- read.xport("theoph.xpt") + +## Revert to mixed case names +names(Theoph.2) <- names(Theoph) + +## Test equality, handling the ordered factor Subject separately because +## SAS xport files don't provide a mechanism for storing factor orders + +SASxport:::assert( all( as.character(Theoph$Subject) == as.character(Theoph.2$Subject) )) +SASxport:::assert( all(Theoph[,-1] == Theoph.2[,-1]) ) + Added: trunk/SASxport/tests/Theoph.Rout.save =================================================================== --- trunk/SASxport/tests/Theoph.Rout.save (rev 0) +++ trunk/SASxport/tests/Theoph.Rout.save 2007-09-07 16:47:08 UTC (rev 1167) @@ -0,0 +1,46 @@ + +R version 2.5.1 (2007-06-27) +Copyright (C) 2007 The R Foundation for Statistical Computing +ISBN 3-900051-07-0 + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> +> #### +> ## Round-trip test on Theoph data +> #### +> +> library(SASxport) + +Attaching package: 'SASxport' + + + The following object(s) are masked from package:base : + + units, + units<- + +> +> write.xport(Theoph,file="theoph.xpt") +> Theoph.2 <- read.xport("theoph.xpt") +> +> ## Revert to mixed case names +> names(Theoph.2) <- names(Theoph) +> +> ## Test equality, handling the ordered factor Subject separately because +> ## SAS xport files don't provide a mechanism for storing factor orders +> +> SASxport:::assert( all( as.character(Theoph$Subject) == as.character(Theoph.2$Subject) )) +> SASxport:::assert( all(Theoph[,-1] == Theoph.2[,-1]) ) +> +> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |