NOAA 的请求限制为 1000。我正在尝试获取 1 年的气候数据(PRCP、TMAX、TMIN 超过 1000)并放入数据框中。
我尝试了一个while循环来一次通过日期范围
start <- as.Date("2013-07-01",format = "%Y%m%d")
end <- as.Date("2014-06-30",format = "%Y%m%d")
theDate <- start
while (theDate <= end)
{
df <- ncdc(
datasetid = 'GHCND',
stationid = 'GHCND:ASN00009225',
token = "token code",
startdate = theDate,
enddate = theDate +1,
limit = 1000
)$data
theDate <- theDate + 1
}
我收到以下错误消息
Error in while (theDate <= end) { : missing value where TRUE/FALSE needed