Re: [Rd] read.table error upon package installation (PR#8230)

2005-10-21 Thread McGehee, Robert
Thanks for this. 

I tried switching the file extension from txt to tab, but it seems to
still split on whitespace rather than tabs.

My goal is to create a file that is both readable by R and by a
spreadsheet program, and that may contain white spaces. If tab-delimited
separation is not currently supported on load time, a CSV file would
also be a natural candidate. Unfortunately for me, it seems that R
expects the CSV file in the 'data' subdirectory to be delimited by
semi-colons rather than commas (which seems odd and might be worthy of
mention in the Writing R Extensions Manual), and the particular
spread-sheet program I use uses commas to delimit CSV files. So, then, I
think that I will be unable to use 'data' subdirectory to load this data
using data(), but any feedback on this is welcomed.

Thanks,
Robert


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 21, 2005 1:58 AM
To: r-devel@stat.math.ethz.ch
Cc: [EMAIL PROTECTED]
Subject: Re: [Rd] read.table error upon package installation (PR#8230)


What is the R error here?

The default delimiter in read.table is not \t but whitespace, so the
first 
example has 2 and 3 rows (fine for header=T) and the second has 2 and 4 
rows.

On Fri, 21 Oct 2005 [EMAIL PROTECTED] wrote:

 Upon upgrading to R 2.2.0 on my Windows box, I found that one of my
 packages no longer compiled, giving this error:

 Error in read.table(zfile, header =3D TRUE) :
   more columns than column names
 Execution halted

 After removing every line of code from my package and still not being
 able to compile it, I found the error to be related to a .txt file in
my
 data directory. I reduced my data file to a very simple example which
 causes the error, and a nearly identical file which does not cause the
 problem.

 A file with these contents causes the error (I am using \t to indicate
 the usual tab delimiter).
 x \t  y
 A B C \t  DEF

 However, if I remove one of the spaces between A and B or B and C, the
 package compiles fine:
 x \t  y
 A BC  \t  DEF

 I can only guess that there is some kind of parsing problem when there
 is more than one space between tab delimiters.

Looks more like a user misunderstanding of ?data.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] read.table error upon package installation (PR#8230)

2005-10-21 Thread Prof Brian Ripley
On Fri, 21 Oct 2005, McGehee, Robert wrote:

 Thanks for this.

 I tried switching the file extension from txt to tab, but it seems to
 still split on whitespace rather than tabs.

 My goal is to create a file that is both readable by R and by a
 spreadsheet program, and that may contain white spaces. If tab-delimited
 separation is not currently supported on load time, a CSV file would
 also be a natural candidate. Unfortunately for me, it seems that R
 expects the CSV file in the 'data' subdirectory to be delimited by
 semi-colons rather than commas (which seems odd and might be worthy of
 mention in the Writing R Extensions Manual), and the particular
 spread-sheet program I use uses commas to delimit CSV files. So, then, I
 think that I will be unable to use 'data' subdirectory to load this data
 using data(), but any feedback on this is welcomed.

Using quotes, e.g. A B C may work?


 Thanks,
 Robert


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Friday, October 21, 2005 1:58 AM
 To: r-devel@stat.math.ethz.ch
 Cc: [EMAIL PROTECTED]
 Subject: Re: [Rd] read.table error upon package installation (PR#8230)


 What is the R error here?

 The default delimiter in read.table is not \t but whitespace, so the
 first
 example has 2 and 3 rows (fine for header=T) and the second has 2 and 4
 rows.

 On Fri, 21 Oct 2005 [EMAIL PROTECTED] wrote:

 Upon upgrading to R 2.2.0 on my Windows box, I found that one of my
 packages no longer compiled, giving this error:

 Error in read.table(zfile, header =3D TRUE) :
  more columns than column names
 Execution halted

 After removing every line of code from my package and still not being
 able to compile it, I found the error to be related to a .txt file in
 my
 data directory. I reduced my data file to a very simple example which
 causes the error, and a nearly identical file which does not cause the
 problem.

 A file with these contents causes the error (I am using \t to indicate
 the usual tab delimiter).
 x\t  y
 A B C\t  DEF

 However, if I remove one of the spaces between A and B or B and C, the
 package compiles fine:
 x\t  y
 A BC \t  DEF

 I can only guess that there is some kind of parsing problem when there
 is more than one space between tab delimiters.

 Looks more like a user misunderstanding of ?data.

 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] read.table error upon package installation (PR#8230)

2005-10-21 Thread McGehee, Robert
Yes, but only, it seems, if you put quotes around all the fields (not
just the A B C). 

Also a note to Excel users, when adding quotes as suggested A B C is
saved as A B C which R reads in differently than Excel.

For my purposes though, everyone who needs to edit this file can just do
so in emacs, and putting quotes around the fields is an easy fix. Thanks

Robert

-Original Message-
From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 21, 2005 9:59 AM
To: McGehee, Robert
Cc: r-devel@stat.math.ethz.ch
Subject: RE: [Rd] read.table error upon package installation (PR#8230)


On Fri, 21 Oct 2005, McGehee, Robert wrote:

 Thanks for this.

 I tried switching the file extension from txt to tab, but it seems to
 still split on whitespace rather than tabs.

 My goal is to create a file that is both readable by R and by a
 spreadsheet program, and that may contain white spaces. If
tab-delimited
 separation is not currently supported on load time, a CSV file would
 also be a natural candidate. Unfortunately for me, it seems that R
 expects the CSV file in the 'data' subdirectory to be delimited by
 semi-colons rather than commas (which seems odd and might be worthy of
 mention in the Writing R Extensions Manual), and the particular
 spread-sheet program I use uses commas to delimit CSV files. So, then,
I
 think that I will be unable to use 'data' subdirectory to load this
data
 using data(), but any feedback on this is welcomed.

Using quotes, e.g. A B C may work?


 Thanks,
 Robert


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Friday, October 21, 2005 1:58 AM
 To: r-devel@stat.math.ethz.ch
 Cc: [EMAIL PROTECTED]
 Subject: Re: [Rd] read.table error upon package installation (PR#8230)


 What is the R error here?

 The default delimiter in read.table is not \t but whitespace, so the
 first
 example has 2 and 3 rows (fine for header=T) and the second has 2 and
4
 rows.

 On Fri, 21 Oct 2005 [EMAIL PROTECTED] wrote:

 Upon upgrading to R 2.2.0 on my Windows box, I found that one of my
 packages no longer compiled, giving this error:

 Error in read.table(zfile, header =3D TRUE) :
  more columns than column names
 Execution halted

 After removing every line of code from my package and still not being
 able to compile it, I found the error to be related to a .txt file in
 my
 data directory. I reduced my data file to a very simple example which
 causes the error, and a nearly identical file which does not cause
the
 problem.

 A file with these contents causes the error (I am using \t to
indicate
 the usual tab delimiter).
 x\t  y
 A B C\t  DEF

 However, if I remove one of the spaces between A and B or B and C,
the
 package compiles fine:
 x\t  y
 A BC \t  DEF

 I can only guess that there is some kind of parsing problem when
there
 is more than one space between tab delimiters.

 Looks more like a user misunderstanding of ?data.

 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] read.table error upon package installation (PR#8230)

2005-10-20 Thread Robert . McGehee
Upon upgrading to R 2.2.0 on my Windows box, I found that one of my
packages no longer compiled, giving this error:

Error in read.table(zfile, header =3D TRUE) :
more columns than column names
Execution halted

After removing every line of code from my package and still not being
able to compile it, I found the error to be related to a .txt file in my
data directory. I reduced my data file to a very simple example which
causes the error, and a nearly identical file which does not cause the
problem.

A file with these contents causes the error (I am using \t to indicate
the usual tab delimiter).
x   \t  y
A B C   \t  DEF

However, if I remove one of the spaces between A and B or B and C, the
package compiles fine:
x   \t  y
A BC\t  DEF

I can only guess that there is some kind of parsing problem when there
is more than one space between tab delimiters.

Robert

 version
 _ =20
platform i386-pc-mingw32
arch i386  =20
os   mingw32   =20
system   i386, mingw32 =20
status =20
major2 =20
minor2.0   =20
year 2005  =20
month10=20
day  06=20
svn rev  35749 =20
language R=20

This e-mail, and any attachments hereto, are intended for us...{{dropped}}

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] read.table error upon package installation (PR#8230)

2005-10-20 Thread ripley
What is the R error here?

The default delimiter in read.table is not \t but whitespace, so the first 
example has 2 and 3 rows (fine for header=T) and the second has 2 and 4 
rows.

On Fri, 21 Oct 2005 [EMAIL PROTECTED] wrote:

 Upon upgrading to R 2.2.0 on my Windows box, I found that one of my
 packages no longer compiled, giving this error:

 Error in read.table(zfile, header =3D TRUE) :
   more columns than column names
 Execution halted

 After removing every line of code from my package and still not being
 able to compile it, I found the error to be related to a .txt file in my
 data directory. I reduced my data file to a very simple example which
 causes the error, and a nearly identical file which does not cause the
 problem.

 A file with these contents causes the error (I am using \t to indicate
 the usual tab delimiter).
 x \t  y
 A B C \t  DEF

 However, if I remove one of the spaces between A and B or B and C, the
 package compiles fine:
 x \t  y
 A BC  \t  DEF

 I can only guess that there is some kind of parsing problem when there
 is more than one space between tab delimiters.

Looks more like a user misunderstanding of ?data.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel