From p.dalgaard at biostat.ku.dk  Mon Nov 17 18:43:16 2008
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Mon, 17 Nov 2008 18:43:16 +0100
Subject: [Rd] stringsAsFactors = FALSE
In-Reply-To: <77EB52C6DD32BA4D87471DCD70C8D70028E443@NA-PA-VBE03.na.tibco.com>
References: <f8e6ff050811170510i576d0014qdb22f08c57690bb2@mail.gmail.com>
	<77EB52C6DD32BA4D87471DCD70C8D70028E443@NA-PA-VBE03.na.tibco.com>
Message-ID: <4921AD34.70404@biostat.ku.dk>

William Dunlap wrote:

>> but I'm not sure why they are being converted to factors in 
>> the first place.
> 
> I think expand.grid converts input strings to factors so they
> retain the order they have in the input. 

Yep. These things do matter. Incidentally, I recently got burned by 
cooking an example using expand.grid, writing the data to a file with 
write.table and reading it back in during lecture with read.table. Odds 
ratio turned upside down...

-- 
    O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



[Rd] stringsAsFactors = FALSE
Peter Dalgaard