我目前正在尝试配置rnoaa库,以便将城市、州数据与气象站连接起来,从而输出年度天气数据,即温度。我已经包含了一个硬编码的输入以供参考,但我打算最终在数百个地理编码的城市中提供数据。与其说这是问题,不如说是检索数据。
require(rnoaa)
require(ggmap)
city<-geocode("birmingham, alabama", output = "all")
bounds<-city$results[[1]]$geometry$bounds
se<-bounds$southwest$lat
sw<-bounds$southwest$lng
ne<-bounds$northeast$lat
nw<-bounds$northeast$lng
stations<-ncdc_stations(extent = c(se, sw, ne, nw),token = noaakey)我正在计算地理区域周围的MBR (矩形),在本例中是伯明翰,然后获得车站列表。然后,我取出station_id,然后尝试使用任何类型的参数检索结果,但都没有成功。我希望将每年的温度与每个城市联系起来。
test <- ncdc(datasetid = "ANNUAL", locationid = topStation[1],
datatypeid = "DSNW",startdate = "2000-01-01", enddate = "2010-01-01",
limit = 1000, token = noaakey)
Warning message:
Sorry, no data found 发布于 2016-04-18 10:58:46
看起来位置ID正在产生问题。尝试不使用它(因为它是可选字段)
ncdc_locs(datasetid = "ANNUAL",datatypeid = "DSNW",startdate = "2000-01-01", enddate = "2010-01-01", limit = 1000,token = <your token key>)然后使用有效的位置ID
ncdc_locs(datasetid = "ANNUAL",datatypeid = "DSNW",startdate = "2000-01-01", enddate = "2010-01-01", limit = 1000,locationid='CITY:US000001',token = <your token>)返回
$meta
NULL
$data
mindate maxdate name datacoverage id
1 1872-01-01 2016-04-16 Washington D.C., US 1 CITY:US000001
attr(,"class")
[1] "ncdc_locs"https://stackoverflow.com/questions/36682150
复制相似问题