Jason Boyd
2002-Feb-15 20:04 UTC
[R] error in read.table on Mac OS 10 ... request for help
Hello, I'm a new user of R, and unsure of why I'm getting an error reading external files on my Mac OS 10 machine. I've read through posts that would seem related (and 'R Import/Export' and 'Introduction to R' as well as pertinent sections in V&R's 'Modern Applied Statistics with S-Plus') but to no avail. If anyone has any suggestions, I'd be very grateful. Here's the problem: When I enter the command:> idusc <- read.table(file = "/Users/Shared/rm140_FULL/work/ioddupb.txt") I get the message: Error in file(file, "r") : cannot open file `/Users/Shared/ rm140_FULL/work/ioddupb.txt' This is the correct path according to my Finder window's "path" tab (that is, as far as Users is a folder under /) and also according to the command line interface (shell). I'm not sure why it can't read the file. I'm new to Unix systems also, so perhaps I've misunderstood paths (though I've been reading over Unix tutorials enough not to scare me). Other info: 1. the file was created in simple text mode in Mac TextEdit and saved fixed width text format. 2. when I save the file to another working directory under a different user, I also cannot read.table 3. I checked the priveleges of the .txt file, they were Read & write for the owner and Read for everyone else so that would seem to take care of R being able to copy it. 4. I also tried read.fwf with the same type error message. 5. The tutorials and examples as well as libraries all work fine, I can read data in the libraries, use add-on functions, and plot so it doesn't seem to be a problem with R itself. I'm sure this is just a simple matter but I'm perplexed. Thanks for any suggestions, Jason Boyd graduate student University of Georgia College of Pharmacy boydj at mail.rx.uga.edu -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Dalgaard BSA
2002-Feb-15 22:02 UTC
[R] error in read.table on Mac OS 10 ... request for help
Jason Boyd <BOYDJ at mail.rx.uga.edu> writes:> When I enter the command: > > > idusc <- read.table(file = "/Users/Shared/ > rm140_FULL/work/ioddupb.txt") > > I get the message: > > Error in file(file, "r") : cannot open file `/Users/Shared/ > rm140_FULL/work/ioddupb.txt'You wouldn't happen to have a line feed inside of the file name, do you? -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Ben Bolker
2002-Feb-19 14:28 UTC
[R] error in read.table on Mac OS 10 ... request for help
I haven't seen any answers to this, so I'll try to provide some other things to try (although I don't really know what's going on). Try getwd() to see how paths appear to be specified internally. You could also try setwd("/Users/Shared/rm140_FULL/work") before read.table("..."). Also try list.files() to check out the file names. It does seem you've been pretty thorough. good luck, Ben Bolker On Fri, 15 Feb 2002, Jason Boyd wrote:> Hello, > I'm a new user of R, and unsure of why I'm getting an > error reading external files on my Mac OS 10 machine. > I've read through posts that would seem related (and 'R > Import/Export' and 'Introduction to R' as well as > pertinent sections in V&R's 'Modern Applied Statistics > with S-Plus') but to no avail. If anyone has any > suggestions, I'd be very grateful. Here's the problem: > > When I enter the command: > > > idusc <- read.table(file = "/Users/Shared/ > rm140_FULL/work/ioddupb.txt") > > I get the message: > > Error in file(file, "r") : cannot open file `/Users/Shared/ > rm140_FULL/work/ioddupb.txt' > > This is the correct path according to my Finder > window's "path" tab (that is, as far as Users is a folder > under /) and also according to the command line > interface (shell). I'm not sure why it can't read the file. > I'm new to Unix systems also, so perhaps I've > misunderstood paths (though I've been reading over > Unix tutorials enough not to scare me). Other info: > > 1. the file was created in simple text mode in Mac > TextEdit and saved fixed width text format. > > 2. when I save the file to another working directory > under a different user, I also cannot read.table > > 3. I checked the priveleges of the .txt file, they were > Read & write for the owner and Read for everyone else > so that would seem to take care of R being able to copy > it. > > 4. I also tried read.fwf with the same type error > message. > > 5. The tutorials and examples as well as libraries all > work fine, I can read data in the libraries, use add-on > functions, and plot so it doesn't seem to be a problem > with R itself. > > I'm sure this is just a simple matter but I'm perplexed. > Thanks for any suggestions, > > Jason Boyd > > graduate student > University of Georgia > College of Pharmacy > boydj at mail.rx.uga.edu > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- 318 Carr Hall bolker at zoo.ufl.edu Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker Box 118525 (ph) 352-392-5697 Gainesville, FL 32611-8525 (fax) 352-392-3704 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._