Message-ID: <20040129192318.GG13695@queenbee.fhcrc.org>
Date: 2004-01-29T19:23:19Z
From: Seth Falcon
Subject: please help me!
In-Reply-To: <1075393163.4019328b670a7@webmail.mines.edu>
If your working directory contains a file you want to read then the
following should work:
dat <- read.table("filename.txt")
If you want to use absolute paths, you have to be careful with the '\'
because that is an escape character... so try:
dat <- read.table("c:/some/path/notice/forward/slashes/data.txt")
# or
dat <- read.table("c:\\double\\back\\should\\work\\data.txt")
On Thu, Jan 29, 2004 at 09:19:23AM -0700, mpalmier at mines.edu wrote:
> hello there,
> I'm a new user to R and I am having difficulty reading a file into the
> program. Here's the error I keep getting, I bet there's a simple solution,
> but I cant find any...
>
> Error in file(file, "r") : unable to open connection
> In addition: Warning message:
> cannot open file `c:MikeWeather2.txt'
>
> I have made sure that my working directory is the same as the place where the
> file is. I have also tried using the full path name of the file. read.table,
> read.delim, read.csv, and scan have all been attempted with no result. What
> causes this message, and how can I fix it. Thanks in advance for your help,
>
> Mike
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html