[Rcpp-commits] r3366 - pkg/int64/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 16 11:44:43 CET 2011


Author: romain
Date: 2011-11-16 11:44:41 +0100 (Wed, 16 Nov 2011)
New Revision: 3366

Modified:
   pkg/int64/R/int64.R
Log:
NA warning when converting character to [u]int64

Modified: pkg/int64/R/int64.R
===================================================================
--- pkg/int64/R/int64.R	2011-11-16 10:41:59 UTC (rev 3365)
+++ pkg/int64/R/int64.R	2011-11-16 10:44:41 UTC (rev 3366)
@@ -102,13 +102,15 @@
 
 as.int64 <- function(x){
     if( is.character(x) ){
-        x[ ! grepl("^[-]?[0-9]+$", x) ] <- NA     
+        x[ ! grepl("^[-]?[0-9]+$", x) ] <- NA
+        warning( "NAs introduced" ) 
     }
     new( "int64", .Call(int64_as_int64, x) ) 
 }
 as.uint64 <- function(x){
     if( is.character(x) ){
-        x[ ! grepl("^[-]?[0-9]+$", x) ] <- NA     
+        x[ ! grepl("^[-]?[0-9]+$", x) ] <- NA
+        warning( "NAs introduced" )
     }
     new( "uint64", .Call(int64_as_uint64, x) ) 
 }



More information about the Rcpp-commits mailing list