R-alpha: more compatibility

Thomas Lumley (thomas@biostat.washington.edu)
Fri, 21 Feb 1997 09:11:27 -0800 (PST)

Date: Fri, 21 Feb 1997 09:11:27 -0800 (PST)
From: Thomas Lumley <thomas@biostat.washington.edu>
To: r-testers@stat.math.ethz.ch
Subject:  R-alpha: more compatibility
In-Reply-To: <199702211546.HAA21564@aggie.pnl.gov>

is.numeric() returns TRUE for logical variables (in S it returns FALSE). 

This means that S code which needs to distinguish these will work if it 
uses is.logical() and fail if it uses is.numeric().

It also means that for a logical vector x the formula y~x is equivalent 
to y~factor(x) in S and y~as.numeric(x) in R. These are different unless 
you use treatment contrasts.

thomas lumley
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch