Re: [R] A slight trap in read.table/read.csv.

2010-03-09 Thread Ivan Calandra
To answer your questions, French people don't have 'Vrai' and 'Faux'. Since most of people have no idea what "csv" means, there's no use for using "dsv"! The "Académie Française" would not be happy indeed. But to keep on the subject, I personally never had troubles using T or F. I sometimes us

Re: [R] A slight trap in read.table/read.csv.

2010-03-09 Thread Barry Rowlingson
On Tue, Mar 9, 2010 at 8:11 AM, Patrick Connolly wrote: > If you use ESS, you have the benefit of completions.  Depending on > what else could begin with T or F, you can press the TAB key after > typing the first letter or two.  Admittedly, three keystrokes isn't > much shorter than TRUE -- but t

Re: [R] A slight trap in read.table/read.csv.

2010-03-09 Thread Patrick Connolly
On Tue, 09-Mar-2010 at 08:14AM +0100, Petr PIKAL wrote: |> I would respectfully oppose it. It may be quite convenient for making code |> for functions and other programming stuff but all using R more or less in |> interactive way this change could be quite a burden especially when there |> are

Re: [R] A slight trap in read.table/read.csv.

2010-03-08 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.03.2010 01:44:38: > > On 9/03/2010, at 11:17 AM, Mike Prager wrote: > > > Rolf Turner wrote: > >> > >> I solved the problem by putting in a colClasses argument in my > >> call to read.csv(). But I really think that the read functions > >> are bei

Re: [R] A slight trap in read.table/read.csv.

2010-03-08 Thread Peter Ehlers
Ditching T/F for TRUE/FALSE would get my vote, too. -Peter Ehlers On 2010-03-08 17:44, Rolf Turner wrote: On 9/03/2010, at 11:17 AM, Mike Prager wrote: Rolf Turner wrote: I solved the problem by putting in a colClasses argument in my call to read.csv(). But I really think that the read

Re: [R] A slight trap in read.table/read.csv.

2010-03-08 Thread Rolf Turner
On 9/03/2010, at 11:17 AM, Mike Prager wrote: > Rolf Turner wrote: >> >> I solved the problem by putting in a colClasses argument in my >> call to read.csv(). But I really think that the read functions >> are being too clever by half here. If field entries are surrounded >> by quotes, shouldn

Re: [R] A slight trap in read.table/read.csv.

2010-03-08 Thread Mike Prager
Rolf Turner wrote: > > I solved the problem by putting in a colClasses argument in my > call to read.csv(). But I really think that the read functions > are being too clever by half here. If field entries are surrounded > by quotes, shouldn't they be left as character? Even if they are > all F

Re: [R] A slight trap in read.table/read.csv.

2010-03-01 Thread Peter Ehlers
On 2010-02-28 14:55, Rolf Turner wrote: I had occasion recently to read in a one-line *.csv file that looked like: "CandidateName","NSN","Ethnicity","dob","gender" "Smith, Mary Jane",111222333,"E","2/25/1989","F" That "F" (for female) in the last field got transformed to FALSE. Apparently rea

Re: [R] A slight trap in read.table/read.csv.

2010-02-28 Thread Don MacQueen
There is, however, an important distinction. Quoting from ?TRUE (or ?logical): 'TRUE' and 'FALSE' are reserved words denoting logical constants in the R language, whereas 'T' and 'F' are global variables whose initial values set to these. All four are 'logical(1)' vectors. TRUE <-

Re: [R] A slight trap in read.table/read.csv.

2010-02-28 Thread Jim Lemon
On 03/01/2010 08:55 AM, Rolf Turner wrote: ... Furthermore using F's and T's to represent TRUE's and FALSE's is bad practice anyway. Since FALSE and TRUE are reserved words it would make sense for the read function to assume that a field is logical if it consists entirely of these words. But T'

Re: [R] A slight trap in read.table/read.csv.

2010-02-28 Thread Gabor Grothendieck
It is strange. Even in R itself T and F are not guaranteed to be TRUE and FALSE. > T <- 1:3 > T [1] 1 2 3 On Sun, Feb 28, 2010 at 4:55 PM, Rolf Turner wrote: > > I had occasion recently to read in a one-line *.csv file that > looked like: > > "CandidateName","NSN","Ethnicity","dob","gender" >

Re: [R] A slight trap in read.table/read.csv.

2010-02-28 Thread David Winsemius
On Feb 28, 2010, at 4:55 PM, Rolf Turner wrote: I had occasion recently to read in a one-line *.csv file that looked like: "CandidateName","NSN","Ethnicity","dob","gender" "Smith, Mary Jane",111222333,"E","2/25/1989","F" That "F" (for female) in the last field got transformed to FALSE. Appa

Re: [R] A slight trap in read.table/read.csv.

2010-02-28 Thread Sharpie
Rolf Turner wrote: > > I solved the problem by putting in a colClasses argument in my > call to read.csv(). But I really think that the read functions > are being too clever by half here. If field entries are surrounded > by quotes, shouldn't they be left as character? Even if they are > all

[R] A slight trap in read.table/read.csv.

2010-02-28 Thread Rolf Turner
I had occasion recently to read in a one-line *.csv file that looked like: "CandidateName","NSN","Ethnicity","dob","gender" "Smith, Mary Jane",111222333,"E","2/25/1989","F" That "F" (for female) in the last field got transformed to FALSE. Apparently read.csv (and hence read.table) are inferring