[R] Error in file(file, "rt") : cannot open the connection

djhayes D.J.Hayes at liverpool.ac.uk
Wed Mar 21 19:43:34 CET 2012


Hi there,

I migrated from Windows7 to Ubuntu (11.10) and am trying to get my R 
back online.
I've switched from Tinn-R to RKWard which seems to work well.

My problem at the moment is that I'm no longer able to read in the data 
file I was working on before.

 >   popafr <- read.table(file="~/Documents/My PhD/Modelling/SAS/SAS 
datasets/SAS export sets/Final reference curve sets/SAS_for_R AFRO 
11jan11.txt",header=T, sep="\t")
Error in file(file, "rt") : cannot open the connection
Calls: read.table -> file
In addition: Warning message:
In file(file, "rt") :
   cannot open file '/home/me/Documents/My PhD/Modelling/SAS/SAS 
datasets/SAS export sets/Final reference curve sets/SAS_for_R AFRO 
11jan11.txt': No such file or directory
 >

I get the same results with:
 >popafr <- read.table(file.choose())
 >popafr <- read.table(file="SAS_for_R AFRO 11jan11.txt",header=T, sep="\t")

The file is physically present in both the getwd() and the directory 
listed above even with the .choose option I receive the same error.


Does this have to do with file permissions? I've tried running sudo su 
and then starting R in a terminal with the same error.

any help is much appreciated.

Hopefully yours,
Daniel



More information about the R-help mailing list