[R] Summary re: read.table on Mac OS 10

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Feb 21 08:13:56 CET 2002


On Wed, 20 Feb 2002, David R. Bickel wrote:

> I am having the same problem (#3) with read.table on Darwin. The edit()
> function is not a work-around for me since I have to read an enormous
> text file. I tried copying the data from TextEdit and pasting it into vi
> and Project Builder, but that didn't help at all. I wonder if this is
> related to the MacOS convention of ending lines with "\l" instead of
> "\n".

It's CR (ctrl-J, \r) as far as I know.

Shouldn't be a problem.  R's input handles all the standard line-ending
conventions (LF, CRLF, CR) on all platforms, and this is tested as part of
the test suite (although I don't know if that is run on MacOS).

> The strange thing is that read.delim() seems to work fine.

and that calls read.table, so the problem is either with the separators or
more likely with surplus separators at the end of lines in some lines.
You can use a dump (use od under Unix) to find out what is really in the
file.

Neither of you have anywhere told us what the actual error message was
in problem number 3.

> On Tuesday, February 19, 2002, at 06:22 †, Jason Boyd wrote:
>
> > Thanks to all who responded.  Not all of the advice
> > helped me with that particular problem, but, I have
> > learned a lot just from your answers.
> >
> > 1.  R for Mac 10 (Carbon version) uses the Mac
> > convention of using ":" for the usual Unix "/" and thanks
> > to Dr. Lumley for that since I'm new to R, Mac10, Macs
> > in general, and Unix.
> > 2.  Interestingly, Dr. Ripley suggested to me not to use
> > spaces in the path as R wouldn't be able to read them.

y(That's not what I said. The posting by the time it reached me had a
surplus newline and space in the file spec, at the end of a path
component. R does handle legal file names including spaces. My comment as
on the file spec as received, not in general.)

[...]

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list