[R] Using metric scaling

Prof Brian D Ripley ripley at stats.ox.ac.uk
Mon Oct 11 08:46:21 CEST 1999

On Mon, 11 Oct 1999, Murray Jorgensen wrote:

> Prof B. Ripley wrote:
> >With that sort of structure it will be painful.  I assume some extra
> >line wrapping occurred in transit?  If so, here is my best idea:
> >
> >t1 <- read.fwf("dist.dat", width=c(4, 22, rep(7, 8)))
> > . . .

That was a reply sent directly to Murray: for some reason he replied to the
list and not to me.

> Actually I am reading an output file of a program that I do not have.

What I was commenting on is that the lines by the time they reached
me had been wrapped so the tenth item was on the next line, like

  10 LAKE ROTOITI         .510   .314   .314   .314   .549   .314   .510

If that is in the original, more work is needed.

> I am using R 0.64.2 under Windows 95. I soon found out that read.fwf()
> requires Perl, which I did not have installed. So I downloaded ActivePerl
> from http://www.activestate.com/ActivePerl/ and installed it, as well as 
> DCOM for Windows 95 (required for Windows 95 machines only) - downloadable
> from http://www.microsoft.com/com/dcom/dcom95/dcom1_3.asp. 
> The install was straightforward (I put DCOM on first, which seemed
> logical). However I still have trouble with read.fwf(). At first I thought
> that it was due to spaces in my directory names, but it persisted after I
> fixed this up. My complete session follows:

As Peter Dalgaard says, debug(read.fwf) will help. My guess is that
either Perl is not in your path (I haven't use Win 95 for a while, but
I suspect at least a reboot is needed to get it there) or that something
else is wrong with the installation. Open an MS-DOS window and type
perl -v for a quick check, then example(read.fwf) in R for a simple
example to debug.

read.fwf in rw0642 did work on Windows 95 when I had access to it.
I am fairly sure that spaces in the file path would be a problem unless
such file names are enclosed in an extra pair of quotes. I'll see if that
can be alleviated. You can of course always use the internal short names.

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