Skip to content

Commit e38478a

Browse files
protecting against R's inconsitencies
1 parent f8bcc6e commit e38478a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

inst/include/Rcpp/DataFrame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Rcpp{
2424
while( att != R_NilValue ){
2525
if( TAG(att) == R_RowNamesSymbol ){
2626
SEXP rn = CAR(att) ;
27-
if( TYPEOF(rn) == INTSXP && LENGTH(rn) == 2 && INTEGER(rn)[0] == NA_INTEGER ) return -INTEGER(rn)[1] ;
27+
if( TYPEOF(rn) == INTSXP && LENGTH(rn) == 2 && INTEGER(rn)[0] == NA_INTEGER ) return abs(INTEGER(rn)[1]) ;
2828
return LENGTH(rn) ;
2929
}
3030
att = CDR(att) ;

0 commit comments

Comments
 (0)