我正在使用 R 包中的ncdc
功能rnoaa
来下载一个站的降雨数据
这是代码:
start_date <- "1895-01-01"
end_date <- "1895-12-31"
datatype <- "PRCP"
siteNumber <- "GHCND:USC00023498"
data <- ncdc(datasetid='GHCND', stationid=siteNumber[j], datatypeid=datatype, startdate = start_date, enddate = end_date)$data
我查了一下,这个站的数据直到 1895-07-31,但我得到的输出只到 1895-01-25:
> dput(data)
structure(list(date = c("1895-01-01T00:00:00", "1895-01-02T00:00:00",
"1895-01-03T00:00:00", "1895-01-04T00:00:00", "1895-01-05T00:00:00",
"1895-01-06T00:00:00", "1895-01-07T00:00:00", "1895-01-08T00:00:00",
"1895-01-09T00:00:00", "1895-01-10T00:00:00", "1895-01-11T00:00:00",
"1895-01-12T00:00:00", "1895-01-13T00:00:00", "1895-01-14T00:00:00",
"1895-01-15T00:00:00", "1895-01-16T00:00:00", "1895-01-17T00:00:00",
"1895-01-18T00:00:00", "1895-01-19T00:00:00", "1895-01-20T00:00:00",
"1895-01-21T00:00:00", "1895-01-22T00:00:00", "1895-01-23T00:00:00",
"1895-01-24T00:00:00", "1895-01-25T00:00:00"), datatype = c("PRCP",
"PRCP", "PRCP", "PRCP", "PRCP", "PRCP", "PRCP", "PRCP", "PRCP",
"PRCP", "PRCP", "PRCP", "PRCP", "PRCP", "PRCP", "PRCP", "PRCP",
"PRCP", "PRCP", "PRCP", "PRCP", "PRCP", "PRCP", "PRCP", "PRCP"
), station = c("GHCND:USC00023498", "GHCND:USC00023498", "GHCND:USC00023498",
"GHCND:USC00023498", "GHCND:USC00023498", "GHCND:USC00023498",
"GHCND:USC00023498", "GHCND:USC00023498", "GHCND:USC00023498",
"GHCND:USC00023498", "GHCND:USC00023498", "GHCND:USC00023498",
"GHCND:USC00023498", "GHCND:USC00023498", "GHCND:USC00023498",
"GHCND:USC00023498", "GHCND:USC00023498", "GHCND:USC00023498",
"GHCND:USC00023498", "GHCND:USC00023498", "GHCND:USC00023498",
"GHCND:USC00023498", "GHCND:USC00023498", "GHCND:USC00023498",
"GHCND:USC00023498"), value = c(0L, 0L, 0L, 0L, 0L, 28L, 56L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 94L, 76L, 102L, 0L, 0L, 137L, 0L,
0L, 0L, 0L, 0L), fl_m = c("", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
), fl_q = c("", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", ""), fl_so = c("0",
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"), fl_t = c("",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "")), row.names = c(NA, -25L), class = c("tbl_df",
"tbl", "data.frame"))
我也尝试过其他年份,但我遇到了同样的问题,只下载了第一个月的数据。
我的代码有问题吗?(我在其他场合使用过这个功能,并且工作正常)