Thor/Ben

Mac's use forward slashes for paths to files. You could probably have figured 
this out by reading the OSX FAQ's, but here goes.

If your .csv file is in a folder called Rstuff in your Documents folder, you 
would use

fr <- read.csv("Users/username/Documents/Rstuff/file.csv")

in the above code, username is your username for your home directory - if you 
don't know it, look in the finder at the name for the little house on the left.

You can also shorten this with

fr<-read.csv("~/Documents/Rstuff/file.csv")

where the "~" is shorthand for your home directory.

Hope this helps.

---
Best wishes,
Andrew
---------------------------------------------------------------------------
Dr. Andrew Beckerman
Department of Animal and Plant Sciences, University of Sheffield, 
Alfred Denny Building, Western Bank, Sheffield S10 2TN, UK
ph +44 (0)114 222 0026; fx +44 (0)114 222 0002 
http://www.beckslab.staff.shef.ac.uk/
http://www.r4all.group.shef.ac.uk/

http://www.flickr.com/photos/apbeckerman/
http://www.warblefly.co.uk
--------------------------------------------------------------------------



Sent with Sparrow

On Monday, 2 May 2011 at 14:33, Ben Bolker wrote: 
> On 05/02/2011 09:28 AM, Thor Jensen wrote:
> > Hello,
> > 
> > I am unable to write a pathway to .csv files saved on my computer. I
> > can get this to work on a windows machine, but the mac returns a
> > message saying the file does not exist. Any tips on how to import
> > data on mac's? For example, the below line was unsuccesful.
> > read.csv(file="Macintosh HD:Users:ThorJ:Desktop:heightweight.csv"
> > 
> > Many thanks,
> > 
> > Thor
> > 
> > _______________________________________________
> > R-SIG-Mac mailing list
> > [email protected]
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 
>  Try working your way to the file interactively within R using
> 
> (fn <- file.choose())
> 
>  and see what R thinks the file is really called.
> 
> _______________________________________________
> R-SIG-Mac mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 

        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to