[R] reading data

JWDougherty jwdougherty at mcihispeed.net
Thu May 6 03:35:50 CEST 2004


On Wednesday 05 May 2004 03:37, Margarida Júlia Rodrigues Igreja wrote:
> Hello,
> I´m trying to read data from a text file but i can´t
>
> When i print:
>  > a<-read.table(file="C:/dados10.txt")
>
> The next error appears:
> Error in file(file, "r") : unable to open connection
> In addition: Warning message:
> cannot open file `C:/dados10.txt'
>   Can you help me?
>
Margarida,

It depends on a number of things.  First, is the "C:" a local harddrive (on 
the machine you are using) non-local.  Second, "C:\" is a DOS/Windows 
construct and the slash particular will be interpreted differently under a 
*nix system than under DOS.  *nixes use the "/" instead.  "C:/dados.txt" 
would seem to indicate the "dados.txt" file in the root directory of a DOS or 
Windows machine.  SO, first be certain on which machine, and on which drive, 
and in which directory on that machine your file is located.  After that, if 
the file is on a non-local drive, then be certain that the drive and 
directory are mounted and readable from the machine on which you are running 
R.  Also, you must determine if you have read rights for the drive, 
directory, and file.  If you don not, you need to have the administrator or 
file owner grant them to you.  Once these steps are done, then by providing 
are the mounted alias of the drive, directory and filename, you should be 
good.  Otherwise, you should be able to copy the data to your working 
directory.  

Good luck,
John Dougherty




More information about the R-help mailing list