[R-SIG-Mac] How to find the path for a file to be read with read.table() in a Mac

Parkhurst, David F. p@rkhur@ @end|ng |rom |nd|@n@@edu
Sat Feb 13 17:02:12 CET 2021

Thank you.  I thought I�d seen in some book that in a Mac, one had to specify paths in the way I tried.

From: Duncan Murdoch <murdoch.duncan using gmail.com>
Date: Saturday, February 13, 2021 at 10:49 AM
To: Parkhurst, David F. <parkhurs using indiana.edu>, r-sig-mac using r-project.org <r-sig-mac using r-project.org>
Subject: Re: [R-SIG-Mac] How to find the path for a file to be read with read.table() in a Mac
On 13/02/2021 10:42 a.m., Parkhurst, David F. wrote:
> I�ve several times to figure this out with no luck.  I�ve moved a tab delimited text file (created from excel) to the desktop to simplify the path.  If I click on the file and ask Get Info, it lists �Where� as  iCloud Drive > Desktop.  If I copy that to the clipboard and paste that into a read.table command in the R console, it comes up as /Users/DFP/Desktop.  But if I try read.table("\\Users\\DFP\\Desktop\\moabsitechem<file:///Users/DFP/Desktop/moabsitechem>"), I get No such file or directory.  How can I get that file into a data frame?
> Is there some place in my Mac that I can put the file so I could enter just the file name, and not the whole path?

It doesn't make sense to use backslashes in the path:  macOS will see
those as part of the name, not as path separators.  Just use
read.table("/Users/DFP/Desktop/moabsitechm") if that's the filename.

Duncan Murdoch

	[[alternative HTML version deleted]]

More information about the R-SIG-Mac mailing list