[R] map does not display maps, MacOSX

Ray Brownrigg ray at mcs.vuw.ac.nz
Wed Nov 5 20:51:48 CET 2003


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




More information about the R-help mailing list