[R] maps does not work

Lukas Gudmundsson lukas.gudmundsson at gmail.com
Fri Oct 12 13:36:26 CEST 2007


Hello,
I found a working but not satisfactory solution. I did compare the
file structures of "maps" and "mapdata" and found that the \data
subdirectories of both packages have one main difference:

maps\data contains a Rdata.zip file with some xxx.r and yyy.rda files.

mapdata\data does not contain any zip file bit a number of r scripts
specifying environment variables

I did extract the files of Rdata.zip into maps\data and removed the
zip file. After that manipulation every thing seams to work fine.

There still the question why I am not able to access the ziped files
and therefore I have tried the prof. Ripleys hints and did comment on
his questions:

> I think the problem is that tempdir() has been set somewhere invalid.
> However, does help() work at all, since that uses the same mechanism?

both help() and "?" work excellent

> Start an R session, printout tempdir() and see if it looks right.  Search
> for the directory on your file system and see if you can create a file in
> it. If it is on a remote file system there could well be permission
> issues.

It seams that i have full writing permissions to the directory  found
by tempdir(), which is on the local computer:

 tempdir()
# [1] "C:\\WINDOWS\\TEMP\\RtmpyFHSdk"

tmp <- tempfile()
write.table(rnorm(10),tmp)
read.table(tmp)

works and I am able to write into the directory with other programs as
well. Therefore I see no point in changing the default settings.






>
> See ?tempdir and set (or unset) environment variables to change tempdir()
> to somewhere else you know is valid.
>
> On Fri, 12 Oct 2007, Lukas Gudmundsson wrote:
>
> > 2007/10/11, Ray Brownrigg <Ray.Brownrigg at mcs.vuw.ac.nz>:
> >> On Thu, 11 Oct 2007, Lukas Gudmundsson wrote:
> >>> Hello,
> >>> I am trying to draw geographical maps with the maps package. However
> >>>
> >>> if I try to access the data following error occurs:
> >>>> require(maps)
> >>>> map()
> >>>
> >>> Fehler in zip.file.extract(file, "Rdata.zip") :
> >>>   'destination' existiert nicht
> >>> # Error in zip.file.extract(file, "Rdata.zip") : 'destination' does not
> >>> exist
> >>>
> >>>> traceback()
> >>>
> >>> 4: zip.file.extract(file, "Rdata.zip")
> >>> 3: data(list = dbname)
> >>> 2: maptype(database)
> >>> 1: map()
> >>>
> >>> To check if I have principle problems with my system I tried:
> >>>> require(mapdata)
> >>>> map('worldHires', col=1:10)
> >>>
> >>> # Works
> >>>
> >>>
> >>> I am running R 2.6.0 and a current version of maps. But I had a
> >>> similar problem with R 2.5.1
> >>> Is this a known issue?
> >>>
> >>> thanks
> >>> Lukas
> >>>
> >> You don't say which OS you are using and I can't reproduce this on Windows so
> >> it is hard to give explicit recommendations, but what if you try running:
> >> R --vanilla
> >> then:
> >> library(maps); map()
> >>
> >> Alternately, try:
> >> map("world")
> >>
> >> I suspect you have something in your workspace or your environment that is
> >> clashing.
> >>
> >> Ray
> >>
> >
> > First at all thanks a lot for the reply and sorry for the incomplete
> > informations:
> > OS: Windows XP, SP2, version 2002
> > The computer is connected to a network with several data servers
> > (uni). R is installed locally at the default location. I have an user
> > and an admin account for this computer. As the problem I have seams
> > not to be common a short history of what I have done so far (without
> > success):
> >
> > 1. Installed the package using the admin login at the default location
> >
> > 2. Installed the package from the usr account into R_LIBS_USER (C:\RLIBS)
> >
> > 3. I have tried to dig into the error using options(error=recover). I
> > did not get to far but
> > file == "C:/RLIBS/maps/data/worldMapEnv.r".
> > I had a look at the zip file in "C:/RLIBS/maps/data". It contains
> > worldMapEnv.r (but as I do not really understand the package
> > architecture I can not interpret its single line contents (worldMapEnv
> > <- "R_MAP_DATA_DIR"))
> >
> > 4. If I am trying to run any thing like example(lm) I am getting the
> > same error in zip.file.extract (but so far i did not care)
> >
> > 5. I tried to call R from the DOS box using R --vanilla but that did
> > not work either
> >
> > 6. I reinstalled maps form several CRAN mirrors
> >
> > 7. I tried to run maps on my private computer at home and that did
> > work... which increases the confusion.
> >
> > again thanks for any help!
> >
> > Lukas
> >
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> --
> 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 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>



More information about the R-help mailing list