[R] is.integer() function

Barry Rowlingson B.Rowlingson at lancaster.ac.uk
Wed Jan 25 19:10:27 CET 2006


Duncan Murdoch wrote:

> Here "numeric vector" is being used in the R-specific technical sense as 
> a vector of double precision values, so the documentor was trying hard 
> to be precise.  The problem is that English also admits the 
> interpretation in a non-technical sense as a vector of numbers.  I 
> believe your country is to blame for the language. :-)


  But can "numeric vector" in the "R-specific technical sense" also mean 
a vector of integer (representation) values? It passes is.numeric() and 
is.vector():

 > x=1:3
 > is.numeric(x)
[1] TRUE
 > is.vector(x)
[1] TRUE
 > is.integer(x)
[1] TRUE


  Unless by the "R-specific technical sense of 'numeric vector'" you 
dont mean something for which is.numeric() and is.vector() are both 
true. Which is perverse. But then large chunks of R are. Anyway, is this 
right:

is.RSpecificTechnicalSenseNumericVector=function(v){is.numeric(v) & 
is.double(v)}

Barry




More information about the R-help mailing list