VeruGHub / easyclimate

Easy access to high-resolution daily climate data for Europe
https://verughub.github.io/easyclimate/
GNU General Public License v3.0
46 stars 1 forks source link

return error early when providing daily date to get_monthly_data #53

Open Pakillo opened 5 months ago

Pakillo commented 5 months ago

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