0

This code works fine on a Macbook, but fails on my Windows desktop with the error:

Error in raster(x) : 
      error in evaluating the argument 'x' in selecting a method for function 'raster': Error: 'merge' is not an exported object from 'namespace:raster'

Any ideas what's causing it?

Full code:

> require(OpenStreetMap)
Loading required package: OpenStreetMap
Loading required package: rJava
Loading required package: raster
Loading required package: sp
Loading required package: rgdal
rgdal: version: 0.8-11, (SVN revision 479M)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.9.2, released 2012/10/08
Path to GDAL shared files: C:/Users/Robin/Documents/R/win-library/3.0/rgdal/gdal
GDAL does not use iconv for recoding strings.
Loaded PROJ.4 runtime: Rel. 4.7.1, 23 September 2009, [PJ_VERSION: 470]
Path to PROJ.4 shared files: C:/Users/Robin/Documents/R/win-library/3.0/rgdal/proj
> lat <- c(51.7, 51.3); lon <- c(-0.53, 0.3)
> map <- openproj(openmap(c(lat[1],lon[1]),c(lat[2],lon[2]), 8, 'osm'))
Error in raster(x) : 
  error in evaluating the argument 'x' in selecting a method for function 'raster': Error: 'merge' is not an exported object from 'namespace:raster'
geotheory
  • 22,624
  • 29
  • 119
  • 196
  • I think its a known bug in raster, and I recall hitting this a while ago - what version of raster (and R for that!) are you on? Update/Retry/Report. – Spacedman Nov 26 '13 at 13:09
  • As a workaround add `mergeTiles=FALSE` to the `openmap` function. I think there's a slight efficiency loss since plotting now has to deal with multiple tiles but until you get a bugfixed raster package that'll work. – Spacedman Nov 26 '13 at 13:12
  • Ah! I was on 2.1-49 and needed latest 2.1-66. Please add as question and I'll close it off. Thanks again spaced – geotheory Nov 26 '13 at 14:03

1 Answers1

1

Its a bug in raster related to the method used to merge tiles - either upgrade or at a pinch use mergeTiles=FALSE.

Spacedman
  • 92,590
  • 12
  • 140
  • 224