0

I'm trying to plot a raster using the "raster" package but I'm running against an error

Here's my code

map = raster("A055E.tif")
plot(map)

 Error in `colnames<-`(`*tmp*`, value = "A055E") : 
 length of 'dimnames' [2] not equal to array extent

sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252       LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rgdal_0.9-1  raster_2.3-0 sp_1.0-15   

loaded via a namespace (and not attached):
[1] grid_3.1.1      lattice_0.20-29 tools_3.1.1    

However, when I run it on a linux machine with the following versions: R version 3.1.1 (2014-07-10) Platform: i686-pc-linux-gnu (32-bit), raster_2.2-31 sp_1.0-15)

it doesn't give me an issue

dvdkamp
  • 156
  • 5
  • Have you tried it with `raster` 2.3 on linux or 2.2 on windows? (that is definitely one different variable in your setups). – hrbrmstr Oct 16 '14 at 21:49

2 Answers2

0

I think that if you update the raster package things will work again.

Robert Hijmans
  • 40,301
  • 4
  • 55
  • 63
0

On windows computer I had similar problem - I couldn't plot 3-band raster map using plotRGB(). The solution was to handly remove package 'raster' and just install it again.