Skip to content

vectorizing test for equality

1 message · Eric Lecoutre

#
Take a look at 'any', which allows to remove missing values before test:

any(y==3, na.rm=TRUE)

If your vector does not contain integers, dont forget to change 'y==3' test 
by something more appropriate. (begin to round with a fixed number of dec. 
for exemple).

Eric
At 00:15 20/12/2002 -0800, you wrote:
__________________________________________________

Eric Lecoutre           Informaticien/Statisticien
Institut de Statistique                        UCL

                               (+32) (0)10 47 30 50
                            lecoutre at stat.ucl.ac.be
     http://www.stat.ucl.ac.be/ISpersonnel/lecoutre
__________________________________________________
Le vrai danger, ce n'est pas quand les ordinateurs
penseront comme des hommes, c'est quand les hommes
penseront comme des ordinateurs.     Sydney Harris