[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-devel
Subject:    Re: lists (PR#88)
From:       Peter Dalgaard <R-bugs () biostat ! ku ! dk>
Date:       1999-02-16 14:11:43
[Download RAW message or body]

> > 
>> > 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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic