Hi, I installed the maps and mapdata libraries on my R-1.8.0 on MacOSX 10.2.8 (jaguar on a powerbook G4), and failed to make the map function work properly: R : Copyright 2003, The R Development Core Team Version 1.8.0 (2003-10-08) [...]> library(maps) > map()Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file `/Users/glaziou/Library/R/maps/mapdata//world.N'> map('usa')Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file `/Users/glaziou/Library/R/maps/mapdata//usa.N'> system('ls -l /Users/glaziou/Library/R/maps/mapdata')total 1796 -rw-r--r-- 1 root staff 143902 Oct 14 11:30 county.G -rw-r--r-- 1 root staff 690260 Oct 14 11:30 county.L -rw-r--r-- 1 root staff 618 Oct 14 11:30 nz.G -rw-r--r-- 1 root staff 13040 Oct 14 11:30 nz.L -rw-r--r-- 1 root staff 2642 Oct 14 11:30 state.G -rw-r--r-- 1 root staff 96892 Oct 14 11:30 state.L -rw-r--r-- 1 root staff 282 Oct 14 11:30 usa.G -rw-r--r-- 1 root staff 58232 Oct 14 11:30 usa.L -rw-r--r-- 1 root staff 74434 Oct 14 11:30 world.G -rw-r--r-- 1 root staff 295152 Oct 14 11:30 world.L -rw-r--r-- 1 root staff 74434 Oct 14 11:30 world2.G -rw-r--r-- 1 root staff 295152 Oct 14 11:30 world2.L -rw-r--r-- 1 root staff 54832 Oct 14 11:30 world2.N Most of contributed libraries are installed in ~/Library/R because I am the only user of that mac and this simplifies backup. I checked the access rights of relevant files and directories and they all seem correct (these are owned by root but are world readable and directories are world cd'able). Compilation of both libraries maps and mapdata went ok. I have the same libraries installed on a linux server where they work perfectly well. A similar error message occurs whether R is started in an xterm, within emacs/ESS on X11, or using the RAqua interface. Any hint appreciated, -- Philippe Glaziou
Notice the // in the path /Users/glaziou/Library/R/maps/mapdata//world.N Some Windows filesystems do not like that, and my guess is that some MacOS X ones may not either. On Wed, 5 Nov 2003, Philippe Glaziou wrote:> Hi, > > I installed the maps and mapdata libraries on my R-1.8.0 on > MacOSX 10.2.8 (jaguar on a powerbook G4), and failed to make the > map function work properly: > > > R : Copyright 2003, The R Development Core Team > Version 1.8.0 (2003-10-08) > [...] > > > library(maps) > > map() > Error in file(file, "r") : unable to open connection > In addition: Warning message: > cannot open file `/Users/glaziou/Library/R/maps/mapdata//world.N' > > map('usa') > Error in file(file, "r") : unable to open connection > In addition: Warning message: > cannot open file `/Users/glaziou/Library/R/maps/mapdata//usa.N' > > system('ls -l /Users/glaziou/Library/R/maps/mapdata') > total 1796 > -rw-r--r-- 1 root staff 143902 Oct 14 11:30 county.G > -rw-r--r-- 1 root staff 690260 Oct 14 11:30 county.L > -rw-r--r-- 1 root staff 618 Oct 14 11:30 nz.G > -rw-r--r-- 1 root staff 13040 Oct 14 11:30 nz.L > -rw-r--r-- 1 root staff 2642 Oct 14 11:30 state.G > -rw-r--r-- 1 root staff 96892 Oct 14 11:30 state.L > -rw-r--r-- 1 root staff 282 Oct 14 11:30 usa.G > -rw-r--r-- 1 root staff 58232 Oct 14 11:30 usa.L > -rw-r--r-- 1 root staff 74434 Oct 14 11:30 world.G > -rw-r--r-- 1 root staff 295152 Oct 14 11:30 world.L > -rw-r--r-- 1 root staff 74434 Oct 14 11:30 world2.G > -rw-r--r-- 1 root staff 295152 Oct 14 11:30 world2.L > -rw-r--r-- 1 root staff 54832 Oct 14 11:30 world2.N > > Most of contributed libraries are installed in ~/Library/R > because I am the only user of that mac and this simplifies > backup. I checked the access rights of relevant files and > directories and they all seem correct (these are owned by root > but are world readable and directories are world cd'able). > Compilation of both libraries maps and mapdata went ok. I have > the same libraries installed on a linux server where they work > perfectly well. > > A similar error message occurs whether R is started in an xterm, > within emacs/ESS on X11, or using the RAqua interface. > > Any hint appreciated, > > -- > Philippe Glaziou > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595
Prof Brian D Ripley <ripley at stats.ox.ac.uk> wrote:> Notice the // in the path > > /Users/glaziou/Library/R/maps/mapdata//world.N > > Some Windows filesystems do not like that, and my guess is that > some MacOS X ones may not either.I noticed that. However, this does not to seem to bother MacOSX too much (R internals on MacOSX may not like it): madeleine:~> pwd /Users/glaziou madeleine:~> ls Library/R//maps//mapdata county.G nz.G state.G usa.G world.G world2.G world2.N county.L nz.L state.L usa.L world.L world2.L madeleine:~> cd Library///////R/maps//mapdata madeleine:~/Library/R/maps/mapdata> pwd /Users/glaziou/Library/R/maps/mapdata -- Philippe
Philippe Glaziou <glaziou at pasteur-kh.org> wrote:> > I installed the maps and mapdata libraries on my R-1.8.0 on > MacOSX 10.2.8 (jaguar on a powerbook G4), and failed to make the > map function work properly: > > > R : Copyright 2003, The R Development Core Team > Version 1.8.0 (2003-10-08) > [...] > > > library(maps) > > map() > Error in file(file, "r") : unable to open connection > In addition: Warning message: > cannot open file `/Users/glaziou/Library/R/maps/mapdata//world.N' > > map('usa') > Error in file(file, "r") : unable to open connection > In addition: Warning message: > cannot open file `/Users/glaziou/Library/R/maps/mapdata//usa.N' > > system('ls -l /Users/glaziou/Library/R/maps/mapdata') > total 1796 > -rw-r--r-- 1 root staff 143902 Oct 14 11:30 county.G > -rw-r--r-- 1 root staff 690260 Oct 14 11:30 county.L > -rw-r--r-- 1 root staff 618 Oct 14 11:30 nz.G > -rw-r--r-- 1 root staff 13040 Oct 14 11:30 nz.L > -rw-r--r-- 1 root staff 2642 Oct 14 11:30 state.G > -rw-r--r-- 1 root staff 96892 Oct 14 11:30 state.L > -rw-r--r-- 1 root staff 282 Oct 14 11:30 usa.G > -rw-r--r-- 1 root staff 58232 Oct 14 11:30 usa.L > -rw-r--r-- 1 root staff 74434 Oct 14 11:30 world.G > -rw-r--r-- 1 root staff 295152 Oct 14 11:30 world.L > -rw-r--r-- 1 root staff 74434 Oct 14 11:30 world2.G > -rw-r--r-- 1 root staff 295152 Oct 14 11:30 world2.L > -rw-r--r-- 1 root staff 54832 Oct 14 11:30 world2.N >Note the actual file requested (usa.N) doesn't actually exist!> : > > Any hint appreciated, >I had this sort of problem on a Windows system, and had to add an extra command into Makefile.win. [Is there recognised such a thing as Makefile.mac? I seem to recall there used to be, but it is not mentioned in the latest R-exts.] What you need to do is add the line: $(CP) ${*}.n ../inst/mapdata/${*}.N # need this here for Mac as the second line of the .gon.g: target in maps/src/Makefile. [note the first character is a tab] I'll fix this (and the //) in the next version. Ray Brownrigg