 

Hi R-sig-geo,

 

I'm running R under windows, and trying to get the example below to work, and wondering why it is not.

I've read the info at:

http://rgdal.sourceforge.net/ <http://rgdal.sourceforge.net/> 

 

Example:

nor_coast_poly <- map("world", "norway", fill=TRUE, col="transparent", plot=FALSE)

> range(nor_coast_poly$x, na.rm=TRUE)

[1]  3.354152 31.026640

> range(nor_coast_poly$y, na.rm=TRUE)

[1] -54.46084  71.12916

> nor_coast_poly <- map("world", "norway", fill=TRUE, col="transparent", plot=FALSE, ylim=c(58,72))

> nor_coast_poly$names

 [1] "Norway"               "Norway:Tana"          "Norway:Stjernoya"    

 [4] "Norway:Karlsoy"       "Norway:Seiland"       "Norway:Soroya"       

 [7] "Norway:Vega"          "Norway:Hareidlandet"  "Norway:Froya"        

[10] "Norway:Andoya"        "Norway:Hitra"         "Norway:Gurskoya"     

[13] "Norway:Langoya"       "Norway:Arnoy"         "Norway:Vannoy"       

[16] "Norway:Mageroya"      "Norway:Hinnoya"       "Norway:Senja"        

[19] "Norway:Sunnhordland"  "Norway:Ringvassoy"    "Norway:Vestvagoy"    

[22] "Norway:Austvagoy"     "Norway:Nordhordland"  "Norway:Bremangerland"

[25] "Norway:Moskenesoya"   "Norway:Kvaloy"        "Norway:Kvaloya"      

[28] "Norway:Smola"         "Norway:Karmoy"        "Norway:Vikna"        

> IDs <- sapply(strsplit(nor_coast_poly$names, ":"), function(x) x[1])

> nor_coast_poly_sp <- map2SpatialPolygons(nor_coast_poly, IDs=IDs, proj4string=CRS("+proj=longlat +datum=wgs84"))

> getSpPnParts(nor_coast_poly_sp)

[1] 30

> plot(nor_coast_poly_sp, col="grey", axes=TRUE)

Error in plot.window(xlim, ylim, log, asp, ...) : 

        need finite 'xlim' values

In addition: Warning messages:

1: no non-missing arguments to min; returning Inf 

2: no non-missing arguments to max; returning -Inf 

3: no non-missing arguments to min; returning Inf 

4: no non-missing arguments to max; returning -Inf

 

 

R starts off like this:

Loading required package: methods

Loading required package: sp

Loading required package: abind

Loading required package: pixmap

Geospatial Data Abstraction Library extensions to R successfully loaded

Search()

 [1] ".GlobalEnv"      "package:spmaps"  "package:rgdal"   "package:pixmap" 

 [5] "package:abind"   "package:sp"      "package:methods" "package:akima"  

 [9] "package:ncdf"    "package:misc3d"  "package:rgl"     "package:tkrplot"

[13] "package:tcltk"   "package:mapproj" "package:mapdata" "package:maps"   

[17] "Autoloads"       "package:base"   

 

So there is no indication that something hasn't been loaded properly?

 

Any help appreciated,

 

Matt.

 

 

Dr Matt Fischer

ANSTO - Environmental Research

PMB1 Menai NSW 2234

Ph: + 61 2 9717 9686

Fax: +61 2 9717 3038

 

 

 

 

 

 

 


	[[alternative HTML version deleted]]


