[Rcpp-commits] r3324 - pkg/int64/R
    noreply at r-forge.r-project.org 
    noreply at r-forge.r-project.org
       
    Sat Nov 12 10:27:48 CET 2011
    
    
  
Author: romain
Date: 2011-11-12 10:27:48 +0100 (Sat, 12 Nov 2011)
New Revision: 3324
Modified:
   pkg/int64/R/int64.R
Log:
starting to add some NA specific behaviour
Modified: pkg/int64/R/int64.R
===================================================================
--- pkg/int64/R/int64.R	2011-11-12 09:25:35 UTC (rev 3323)
+++ pkg/int64/R/int64.R	2011-11-12 09:27:48 UTC (rev 3324)
@@ -102,13 +102,13 @@
 
 as.int64 <- function(x){
     if( is.character(x) ){
-        x[ ! grepl("^[-][0-9]+$", x) ] <- NA     
+        x[ ! grepl("^[-]?[0-9]+$", x) ] <- NA     
     }
     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     
     }
     new( "uint64", .Call(int64_as_uint64, x) ) 
 }
    
    
More information about the Rcpp-commits
mailing list