Re: [R] The behaviour of read.csv().

2010-12-05 Thread Duncan Murdoch
On 05/12/2010 2:14 PM, Rolf Turner wrote: On 6/12/2010, at 3:00 AM, Duncan Murdoch wrote: I was going to suggest using DIF rather than CSV. It contains more internal information about the file (including the type of each entry), but has the disadvantage of being less readable, even though it

Re: [R] The behaviour of read.csv().

2010-12-05 Thread David Winsemius
On Dec 5, 2010, at 2:14 PM, Rolf Turner wrote: On 6/12/2010, at 3:00 AM, Duncan Murdoch wrote: As of r53778, the bugs I noticed should be fixed. read.DIF now respects the internal type information, so it will keep character strings like "001" as type character (unless you ask it to change

Re: [R] The behaviour of read.csv().

2010-12-05 Thread Rolf Turner
On 6/12/2010, at 3:00 AM, Duncan Murdoch wrote: >> I was going to suggest using DIF rather than CSV. It contains more >> internal information about the file (including the type of each entry), >> but has the disadvantage of being less readable, even though it is ascii. I don't think DI

Re: [R] The behaviour of read.csv().

2010-12-05 Thread Duncan Murdoch
On 03/12/2010 7:08 AM, Duncan Murdoch wrote: On 02/12/2010 9:59 PM, Rolf Turner wrote: On 3/12/2010, at 3:48 PM, David Scott wrote: On 03/12/10 14:33, Duncan Murdoch wrote: I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. The comment in the NEWS file sugges

Re: [R] The behaviour of read.csv().

2010-12-03 Thread Duncan Murdoch
On 02/12/2010 9:59 PM, Rolf Turner wrote: On 3/12/2010, at 3:48 PM, David Scott wrote: On 03/12/10 14:33, Duncan Murdoch wrote: I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. The comment in the NEWS file suggests it was in response to some strange csv file

Re: [R] The behaviour of read.csv().

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 9:33 PM, Duncan Murdoch wrote: On 02/12/2010 9:18 PM, David Winsemius wrote: On Dec 2, 2010, at 8:33 PM, Duncan Murdoch wrote: snipped I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. The comment in the NEWS file suggests it was in response to some st

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Rolf Turner
On 3/12/2010, at 3:48 PM, David Scott wrote: > On 03/12/10 14:33, Duncan Murdoch wrote: >> I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. >> The comment in the NEWS file suggests it was in response to some strange >> csv file coming out of Excel. >> >> The real

Re: [R] The behaviour of read.csv().

2010-12-02 Thread David Scott
On 03/12/10 14:33, Duncan Murdoch wrote: On 02/12/2010 8:04 PM, Peter Ehlers wrote: On 2010-12-02 16:26, Rolf Turner wrote: 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

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Duncan Murdoch
On 02/12/2010 9:18 PM, David Winsemius wrote: On Dec 2, 2010, at 8:33 PM, Duncan Murdoch wrote: snipped I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. The comment in the NEWS file suggests it was in response to some strange csv file coming out of Excel. The real problem

Re: [R] The behaviour of read.csv().

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 8:33 PM, Duncan Murdoch wrote: snipped I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. The comment in the NEWS file suggests it was in response to some strange csv file coming out of Excel. The real problem with the CSV format is that there really

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Rolf Turner
On 3/12/2010, at 2:04 PM, Peter Ehlers wrote: > Rolf, > This is not to argue with your point re counter-intuitive, > but I always run a count.fields() first if I haven't seen > (or can't easily see) the file in my editor. I must have > learned that the hard way a long time ago. Sound

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Duncan Murdoch
On 02/12/2010 8:04 PM, Peter Ehlers wrote: On 2010-12-02 16:26, Rolf Turner wrote: 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 d

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Peter Ehlers
On 2010-12-02 16:26, Rolf Turner wrote: 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

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Rolf Turner
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 unexpe

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Phil Spector
Rolf - I'd suggest using junk <- read.csv("junk.csv",header=TRUE,fill=FALSE) if you don't want the behaviour you're seeing. - Phil Spector Statistical Computing Facility

[R] The behaviour of read.csv().

2010-12-02 Thread Rolf Turner
I have recently been bitten by an aspect of the behaviour of the read.csv() function. Some lines in a (fairly large) *.csv file that I read in had too many entries. I would have hoped that this would cause read.csv() to throw an error, or at least issue a warning, but it read the file without co