[R] Problem with read.table and scan

David White dwhite at ling.ohio-state.edu
Mon Sep 24 23:36:28 CEST 2001


Hi Scott,

You may have some missing data points or something. Try reading the file
in with this command:

air <- read.table("air.data",header=TRUE, fill=TRUE)

Fill will replace missing data with NA
Also, a previous response suggested using the complete address i.e.
"c\...\air.data". Notice that R uses Unix style slashes \ to avoid
confusion with the division symbol and to keep with Unix style.

S. David White
sdavidwhite at bigfoot.com
Columbus, Ohio

On Mon, 24 Sep 2001, Scott, Uriel wrote:

%
%The R version is 1.3.1 and the following is an example of the problem:
%
%> air <- read.table("air.data",header=TRUE)
%Error in file(file, "r") : cannot open file `air.data'
%
%-----Original Message-----
%From: Jens Nieschulze [mailto:jniesch at gwdg.de]
%Sent: Monday, September 24, 2001 2:34 PM
%To: Scott, Uriel
%Subject: Re: [R] Problem with read.table and scan
%
%
%On Mon, 24 Sep 2001, Scott, Uriel wrote:
%
%>
%> I have just installed R on a Windows NT system.  Unfortunately I am unable
%> to open any of the data files I wish to work with.  I have tried using
%> read.table and scan and to the best of my knowledge am using the correct
%> syntax.  The error message I receive is
%>
%> Error in file(file, "r") : cannot open file [file name]
%>
%> I have the data in text files in white-space delimited form.  I put them
%in
%> the rw1031 directory.
%can you privede the R version and a complete code example?
%otherwise it is just random guessing
%from others
%	J
%>
%> Thanks,
%>
%> Uriel Scott
%> Quantitative Analyst
%> Mirant Americas, Inc.
%> 678-579-3226
%>
%>
%-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
%-.-
%> 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
%>
%_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
%_._
%>
%
%***********************************************************************
%Jens Nieschulze
%
%Institute for Forest Biometrics &	Phone: ++49-551-39-12107
%Applied Computer Science		Fax  : ++49-551-39-3465
%Buesgenweg 4
%37077 Goettingen		E-mail: jniesch at uni-forst.gwdg.de
%GERMANY				http://www.uni-forst.gwdg.de/~jniesch
%-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
%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
%_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
%

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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