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 PS:The operating sistem i??m using is Unix
Unix does not file paths like C:/dados10.txt. It's an issue with your local environment, so please ask your local advisors. On Wed, 5 May 2004, 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 > > PS:The operating sistem i??m using is Unix-- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
(Reply to Margarida J??lia Rodrigues Igreja) Hello!> 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?Contrary to what Professor Ripley wrote, this file name is of course totally valid under unixoid systems. But 'C:' looks like a windows hard drive mounted under a Unix directory named 'C:'. Usually this is done directly under '/', so just try: a<-read.table(file="/C:/dados10.txt") -cl -- Christoph Lange MPI fuer biologische Kybernetik |Phone: +49-7071-601-607| Postfach 2169, D-72012 Tuebingen |FAX: +49-7071-601-616|
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