isNumeric | R Documentation |
Checks if an SEXP is of Certain Type
isNumeric(s)
s |
(SEXP) An R object. |
(Rboolean
) true
(=1) or false
(=0).
#include <Rinternals.h> Rboolean Rf_isNumeric(SEXP); #define isNumeric Rf_isNumeric
library(base) is.numeric(integer(length = 2L)) ## TRUE is.numeric(numeric(length = 2L)) ## TRUE is.numeric(factor(c("a", "b"))) ## FALSE is.numeric(logical(length = 2L)) ## FALSE but isNumeric() = true!
Declaration: src/include/Rinternals.h and src/include/Rdefines.h
Implementation: Inline function isNumeric(SEXP s)
, cf. src/include/Rinlinedfuns.h
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.