Skip to content
Back to formatted view

Raw Message

Message-ID: <4921AD34.70404@biostat.ku.dk>
Date: 2008-11-17T17:43:16Z
From: Peter Dalgaard
Subject: stringsAsFactors = FALSE
In-Reply-To: <77EB52C6DD32BA4D87471DCD70C8D70028E443@NA-PA-VBE03.na.tibco.com>

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