1
我創建了下面的腳本來獲得丹麥R稱重shape文件:「在plot.window錯誤(...):需要有限‘ylim’值」
# Get Shapefiles for Coastline
shpurl <- "http://download.geofabrik.de/europe/denmark-latest.shp.zip"
tmp <- tempfile(fileext=".zip")
download.file(shpurl, destfile = tmp)
files <- unzip(tmp, exdir=getwd())
# Load & plot shapefile
library(maptools)
shp <- readShapePoly(files[grep(".shp$", shpurl)])
plot(shp)
的海岸線這應該給我丹麥的輪廓,但是,我不斷收到以下錯誤:
Error in plot.window(...) : need finite 'ylim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf
任何幫助或方向表示讚賞。
你有沒有嘗試閱讀shapefile的任何[其他方式](https://www.nceas.ucsb.edu/scicomp/usecases/ReadWriteESRIShapeFiles)? – Konrad