[R] read.table (trying one more time)

David Winsemius dwinsemius at comcast.net
Thu Feb 25 22:17:52 CET 2010


On Feb 25, 2010, at 3:10 PM, Mestat wrote:

>
> Hey listers,
> I've posted this doubt other day... But I am still having a hard  
> time...
> I have a MAC and I am not getting how to use the read.table command...
> At the bottom of the FINDER application I have the following path:
>
> Macintosh HD>Usuários>User>Marcio>UdeM>Travail Dirigé>Data>MU284
> Population.txt
>
> I didn't find out how I could copy and paste this path as it is  
> possible to
> do with the Windows. But, it's ok, cause I am trying the following  
> command
> with all possible choices, as below:
>
> file<-read.table("/User/Marcio/UdeM/Travail Dirigé/Data/MU284
> Population.txt",header=T,skip=24)
> file<-read.table("/Users/Marcio/UdeM/Travail Dirigé/Data/MU284
> Population.txt",header=T,skip=24)
> file<-read.table("/Usuários/User/Marcio/UdeM/Travail Dirigé/Data/MU284
> Population.txt",header=T,skip=24)
> file<-read.table("/Usuários/Users/Marcio/UdeM/Travail Dirigé/Data/ 
> MU284
> Population.txt",header=T,skip=24)

>
> I've checked already the forum and I found a similar post that says  
> to use
> the command with the following path: "/Users/Marcio/UdeM/Travail
> Dirigé/Data/MU284 Population.txt"
> But at the bottom of the FINDER application is just USER.
> Anyway I tried those options and other... But didn't work...
> If anybody could give me a clue... THANKS A LOT!!!

Two choices (and in any case, don't call your input dataframe just  
"file", although that is probably not why you are having problems):

option 1) Type in:

file_inp <-read.table("",header=T,skip=24)
### then click-hold-drag the file from a Finder window to the R  
console until the cursor bar is between the two quotes, then "release- 
click".

optiuon 2)

file_inp<-read.table(file=file.choose(),header=T,skip=24)

## and then navigate to the location of your file using the Mac File  
Chooser window.

And in the future, such questions should go to the Mac-SIG list.

-- 
David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-help mailing list