NOAA has a request limit of 1000. I am trying to get 1 year worth of climate data of (PRCP, TMAX, TMIN which is over 1000) and put into a data frame.
I have tried a while loop to go through the date range one day at a time
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
}
I get the following error message
Error in while (theDate <= end) { : missing value where TRUE/FALSE needed