lists (PR#88)

Peter Dalgaard R-bugs@biostat.ku.dk
Tue, 16 Feb 1999 15:11:43 +0100


> > 
>> > mode(c(23,42))
>> > is.vector(c(23,42),mode="numeric")
>> > is.vector(c(23,42),mode=c("integer","double","logical"))
>> 
>> Not sure I understand the problem:
> 
> 
> What I had in mind was that it would give TRUE if any of the vector
> had any of these modes i.e. some way of checking several modes at the
> same time without calling is.vector several times. I am looking for
> vectors upon which I can do calculations, as in those given. In
> retrospective, the example is poor. More logically, it should either
> use any() or ||.

I believe this is not a bug. You can get the effect you want fairly easily with

either 

any(sapply(modes,function(y)is.vector(x,mode=y)))

or

any(mode(x) == modes) # or storage.mode to distinguish double/integer

Moving report to "trashcan" (it can be picked up again, don't worry.)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._