The R Project SVN R

Rev

Rev 49020 | Rev 51659 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 49020 Rev 49903
Line 455... Line 455...
455
    default:
455
    default:
456
	return FALSE;
456
	return FALSE;
457
    }
457
    }
458
}
458
}
459
 
459
 
-
 
460
/** Is an object "Numeric" or  complex */
-
 
461
INLINE_FUN Rboolean isNumber(SEXP s)
-
 
462
{
-
 
463
    switch(TYPEOF(s)) {
-
 
464
    case INTSXP:
-
 
465
	if (inherits(s,"factor")) return FALSE;
-
 
466
    case LGLSXP:
-
 
467
    case REALSXP:
-
 
468
    case CPLXSXP:
-
 
469
	return TRUE;
-
 
470
    default:
-
 
471
	return FALSE;
-
 
472
    }
-
 
473
}
-
 
474
 
460
/* As from R 2.4.0 we check that the value is allowed. */
475
/* As from R 2.4.0 we check that the value is allowed. */
461
INLINE_FUN SEXP ScalarLogical(int x)
476
INLINE_FUN SEXP ScalarLogical(int x)
462
{
477
{
463
    SEXP ans = allocVector(LGLSXP, 1);
478
    SEXP ans = allocVector(LGLSXP, 1);
464
    if (x == NA_LOGICAL) LOGICAL(ans)[0] = NA_LOGICAL;
479
    if (x == NA_LOGICAL) LOGICAL(ans)[0] = NA_LOGICAL;