[R] loading a file in R in mac OS X
Marc Schwartz
marc_schwartz at me.com
Thu Jul 16 15:04:47 CEST 2009
On Jul 16, 2009, at 7:40 AM, Michael Knudsen wrote:
> On Thu, Jul 16, 2009 at 1:32 PM, caballo<jamespitts at hotmail.com>
> wrote:
>
>> Error in file(file, "r") : cannot open the connection
>> In addition: Warning message:
>> In file(file, "r") :
>> cannot open file 'c:\harddrivename\users\username\desktop
>> \schools.txt':
>> No such file or directory.
>>
>> I'm guessing that there's a different way to enter the path name on a
>> macintosh?
>
> There is no such thing as a c-drive on a Mac. Try this location
> instead:
>
> ~/Desktop/schools.txt
>
> and note that Mac is case-sensitive.
Actually, by default, the OSX HFS+ file system is not case sensitive:
MacBookPro:~ ~$ ls -la /users/marcschwartz/desktop/
total 32
drwx------+ 5 marcschwartz staff 170 Jul 16 07:49 .
drwxr-xr-x+ 54 marcschwartz staff 1836 Jul 16 07:48 ..
-rw-------@ 1 marcschwartz staff 15364 Jul 16 07:49 .DS_Store
-rw-r--r-- 1 marcschwartz staff 0 Jul 16 07:49 MYFILE
drwxr-xr-x 51 marcschwartz staff 1734 Jul 11 16:34 Test
MacBookPro:~ ~$ ls -la /Users/marcschwartz/Desktop/
total 32
drwx------+ 5 marcschwartz staff 170 Jul 16 07:49 .
drwxr-xr-x+ 54 marcschwartz staff 1836 Jul 16 07:48 ..
-rw-------@ 1 marcschwartz staff 15364 Jul 16 07:49 .DS_Store
-rw-r--r-- 1 marcschwartz staff 0 Jul 16 07:49 MYFILE
drwxr-xr-x 51 marcschwartz staff 1734 Jul 11 16:34 Test
MacBookPro:~ ~$ ls -la /users/marcschwartz/desktop/MYFILE
-rw-r--r-- 1 marcschwartz staff 0 Jul 16 07:49 /users/marcschwartz/
desktop/MYFILE
MacBookPro:~ ~$ ls -la /users/marcschwartz/desktop/myfile
-rw-r--r-- 1 marcschwartz staff 0 Jul 16 07:49 /users/marcschwartz/
desktop/myfile
You can make it so using the Disk Utility, but there are risks to
doing so, in that certain OSX applications will fail. See:
http://www.macfixit.com/staticpages/index.php?page=2003111009264885
HTH,
Marc Schwartz
More information about the R-help
mailing list