[Rcpp-commits] r3396 - pkg/int64/inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 24 09:54:32 CET 2011


Author: romain
Date: 2011-11-24 09:54:32 +0100 (Thu, 24 Nov 2011)
New Revision: 3396

Modified:
   pkg/int64/inst/unitTests/runit.int64.R
Log:
testing read.csv

Modified: pkg/int64/inst/unitTests/runit.int64.R
===================================================================
--- pkg/int64/inst/unitTests/runit.int64.R	2011-11-23 14:15:01 UTC (rev 3395)
+++ pkg/int64/inst/unitTests/runit.int64.R	2011-11-24 08:54:32 UTC (rev 3396)
@@ -138,3 +138,15 @@
     checkEquals( df$c[3:4], df$c[1:2] + 2L )
 }
 
+test.read.csv <- function(){
+    df <- data.frame( x = 1:10, y = 1:10, z = 1:10 )
+    tf <- tempfile()
+    write.table( df, tf, row.names = FALSE, sep = "," )
+    df <- read.csv( tf, header = TRUE, 
+        colClasses = c( "integer", "int64", "uint64" ) )
+    
+    checkEquals( df$x, 1:10 )
+    checkEquals( df$y, as.int64(1:10) )
+    checkEquals( df$z, as.uint64(1:10) )
+}
+



More information about the Rcpp-commits mailing list