From jfox at mcmaster.ca  Sat Sep 13 10:01:59 2003
From: jfox at mcmaster.ca (John Fox)
Date: Sat Sep 13 14:59:14 2003
Subject: [Rd] bug or feature? (PR#4150)
In-Reply-To: <200309131137.h8DBbSJH021576@pubhealth.ku.dk>
Message-ID: <5.1.0.14.2.20030913085648.01fa3170@127.0.0.1>

Dear Axel,

At 01:37 PM 9/13/2003 +0200, axel.benz@iao.fhg.de wrote:
>Full_Name: Axel Benz
>Version: 1.7.1
>OS: Windows
>Submission from: (NULL) (137.251.33.43)
>
>
>This feature seems to be a basic bug:
>
> > 1=="1"
>[1] TRUE
> > as.numeric(1)=="1"
>[1] TRUE
> > as.numeric(1)==as.character("1")
>[1] TRUE
>
>isn't it necessary to distinguish beteen numbers and characters??

Coercion to a common mode takes place in many contexts; for example:

         > 1 & TRUE
         [1] TRUE

To distinguish between numbers and characters you can, of course, use the 
predicates is.numeric() and is.character(), or test that the mode() of the 
arguments is the same.

John
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox@mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox


[Rd] bug or feature? (PR#4150)
John Fox