easyclimate icon indicating copy to clipboard operation
easyclimate copied to clipboard

return error early when providing daily date to get_monthly_data

Open Pakillo opened this issue 1 year ago • 0 comments

If providing a daily date (e.g. 2021-01-20), the function proceeds and starts data download but gives error afterwards. Better to check that period is a month (yyyy-mm) and not a day (yyyy-mm-dd) at the beginning to save time and server load. Also to avoid confusion of some users which may not understand the error.

Reprex:

library(easyclimate)

coords <- data.frame(lon = -5.36, lat = 37.40)
ex <- get_monthly_climate(coords, period = "2001-01-10")
#> Connecting to the server...
#> Error: [subset] invalid name(s)

Created on 2024-04-16 with reprex v2.1.0

Pakillo avatar Apr 16 '24 12:04 Pakillo