From telford@progsoc.uts.edu.au  Tue May 23 08:47:06 2000
From: telford@progsoc.uts.edu.au (Telford Tendys)
Date: Tue, 23 May 2000 17:47:06 +1000
Subject: [Rd] Suggestion for comments in data files (i.e. read.table)
In-Reply-To: <Pine.GSO.4.05.10005230656200.21900-100000@auk.stats>; from ripley@stats.ox.ac.uk on Tue, May 23, 2000 at 07:05:37AM +0100
References: <20000523112605.A29672@ftoomsh.progsoc.uts.edu.au> <Pine.GSO.4.05.10005230656200.21900-100000@auk.stats>
Message-ID: <20000523174706.A14617@ftoomsh.progsoc.uts.edu.au>

> I am sure it is not `a very small change', I'm afraid.  Basically, input is
> not done in a line-oriented way. read.table uses scan and count.fields.  
> Both are internal functions that work at a char-by-char level.  You will
> need to add logic to skip lines, and for your rule that means adding logic
> to know that # is first in a line.

I just wanted to see if was a good idea in principle but thanks for
pointing out that read.table is not line oriented, I have not even started
to work through what would actually be required.

> My suggestion would be to allow # anywhere on the line to skip the
> rest of the line, and to make sure that # inside quotes did nothing.

Well it should be whatever is consistent with R source code unless there
is a good reason to make it otherwise, that minimises the learning required
for new users. Doing a quick test I see that allowing a comment to start
anywhere on the line is correct:

> x <- "# comment" # put the value "# comment" into x
> x
[1] "# comment"
> 

So I'm perfectly happy with that.

If the comment option defaulted to FALSE then it would be safe against
breaking existing code (I suppose everyone knew that already).

	- Tel
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Suggestion for comments in data files (i.e. read.table)
Telford Tendys