Installing R’s maps package on Ubuntu

April 16, 2012
By

(This article was first published on PlanetFlux, and kindly contributed to R-bloggers)

I recently ran into trouble trying to install the R maps package on Ubuntu 10.04.  Here’s the error I was getting: ** arch – gcc -std=gnu99 -O3 -pipe  -g    Gmake.c   -o GmakeGmake.c: In function ‘get_lh’:Gmake.c:111: warning: cast from pointer to integer of different sizeGmake.c:113: warning: cast from pointer to integer of different sizeGmake.c: In function ‘main’:Gmake.c:211: warning: cast from pointer to integer of different sizeGmake.c:214: warning: cast from pointer to integer of different sizeGmake.c:217: warning: cast from pointer to integer of different sizeGmake.c:219: warning: cast from pointer to integer of different sizeGmake.c:221: warning: cast from pointer to integer of different sizeGmake.c:224: warning: cast from pointer to integer of different sizeGmake.c:227: warning: cast from pointer to integer of different sizegcc -std=gnu99 -O3 -pipe  -g    Lmake.c   -o LmakeLmake.c: In function ‘main’:Lmake.c:223: warning: cast from pointer to integer of different sizeLmake.c:228: warning: cast from pointer to integer of different sizeLmake.c:230: warning: cast from pointer to integer of different sizeLmake.c:232: warning: cast from pointer to integer of different sizeLmake.c:235: warning: cast from pointer to integer of different sizeConverting world to world2f convert.awk < world.line > world2.line/bin/bash: f: command not foundmake: [world2.line] Error 127 (ignored)make county.L state.L usa.L nz.L world.L world2.L italy.L france.L state.vbm.L state.carto.Lmake[1]: Entering directory `/tmp/Rtmp4lXbpt/R.INSTALL375371de/maps/src’./Lmake 0 s b county.line county.linestats ../inst/mapdata/county.L./Lmake 0 s b state.line state.linestats ../inst/mapdata/state.L./Lmake 0 s b usa.line usa.linestats ../inst/mapdata/usa.L./Lmake 0 s b nz.line nz.linestats ../inst/mapdata/nz.L./Lmake 0 s b world.line world.linestats ../inst/mapdata/world.L./Lmake 0 s b world2.line world2.linestats ../inst/mapdata/world2.LCannot read left and right at line 1make[1]: *** [world2.L] Error 1make[1]: Leaving directory `/tmp/Rtmp4lXbpt/R.INSTALL375371de/maps/src’make: *** [ldata] Error 2ERROR: compilation failed for package ‘maps’* removing ‘/usr/local/lib/R/site-library/maps’ERROR: dependency ‘maps’ is not available for package ‘ramps’* removing ‘/usr/local/lib/R/site-library/ramps’The downloaded packages are in ‘/tmp/RtmpsAvFte/downloaded_packages’After banging my head on it for awhile, I eventually found that if you 

  1. download the tar.gz from CRAN
  2. change line 55 of the Makefile to:awk -f convert.awk < world.line > world2.line

it will install fine.

Tags: 

To leave a comment for the author, please follow the link and comment on their blog: PlanetFlux.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Sponsors

Mango solutions



RStudio homepage



Zero Inflated Models and Generalized Linear Mixed Models with R

Dommino data lab

Quantide: statistical consulting and training



http://www.eoda.de







ODSC

ODSC

CRC R books series





Six Sigma Online Training





Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)