Skip to content
Back to formatted view

Raw Message

Message-ID: <A0220868-F271-4DF1-9BE9-1381A6193B74@auckland.ac.nz>
Date: 2010-12-03T00:26:32Z
From: Rolf Turner
Subject: The behaviour of read.csv().
In-Reply-To: <alpine.DEB.2.00.1012021608280.12888@springer.Berkeley.EDU>

On 3/12/2010, at 1:08 PM, Phil Spector wrote:

> Rolf -
>    I'd suggest using
> 
>     junk <- read.csv("junk.csv",header=TRUE,fill=FALSE)
> 
> if you don't want the behaviour you're seeing.


The point is not that I don't want this kind of behaviour.
The point is that it seems to me to be unexpected and dangerous.

I can indeed take precautions against it, now that I know about it,
by specifying fill=FALSE.  Given that I remember to do so.

Now that you've pointed it out I can see that this is the reason
for the different behaviour between read.table() and read.csv();
in read.table() fill=FALSE is effectively the default.

Having fill=TRUE being the default in read.csv() strikes me as
being counter-intuitive and dangerous.

	cheers,

		Rolf