VeruGHub / easyclimate

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

remove days from 'date' column when getting monthly data #51

Open Pakillo opened 3 months ago

Pakillo commented 3 months ago

date values should be yyyy-mm

library(easyclimate)

coords <- data.frame(lon = -5.36, lat = 37.40)
ex <- get_monthly_climate(coords, period = 2008)
#> Connecting to the server...
#> 
#> Downloading Prcp data... This process might take several minutes
ex
#>    ID_coords   lon  lat       date   Prcp daily_Prcp_NA
#> 1          1 -5.36 37.4 2008-01-01  45.92             0
#> 2          1 -5.36 37.4 2008-02-01  45.40             0
#> 3          1 -5.36 37.4 2008-03-01  10.82             0
#> 4          1 -5.36 37.4 2008-04-01 167.75             0
#> 5          1 -5.36 37.4 2008-05-01  55.11             0
#> 6          1 -5.36 37.4 2008-06-01   0.00             0
#> 7          1 -5.36 37.4 2008-07-01   0.00             0
#> 8          1 -5.36 37.4 2008-08-01   0.00             0
#> 9          1 -5.36 37.4 2008-09-01  33.50             0
#> 10         1 -5.36 37.4 2008-10-01  61.56             0
#> 11         1 -5.36 37.4 2008-11-01  31.68             0
#> 12         1 -5.36 37.4 2008-12-01  51.36             0

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

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.3.3 (2024-02-29) #> os Ubuntu 20.04.6 LTS #> system x86_64, linux-gnu #> ui X11 #> language en_GB:en #> collate en_GB.UTF-8 #> ctype en_GB.UTF-8 #> tz Europe/Madrid #> date 2024-04-16 #> pandoc 3.1.1 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> bitops 1.0-7 2021-04-24 [1] RSPM (R 4.3.0) #> cli 3.6.2 2023-12-11 [1] RSPM (R 4.3.0) #> codetools 0.2-19 2023-02-01 [2] CRAN (R 4.3.3) #> digest 0.6.35 2024-03-11 [1] CRAN (R 4.3.3) #> easyclimate * 0.2.1 2024-04-16 [1] local #> evaluate 0.23 2023-11-01 [1] RSPM (R 4.3.0) #> fastmap 1.1.1 2023-02-24 [1] RSPM (R 4.3.0) #> fs 1.6.3 2023-07-20 [1] RSPM (R 4.3.0) #> glue 1.7.0 2024-01-09 [1] RSPM (R 4.3.0) #> htmltools 0.5.8.1 2024-04-04 [1] RSPM (R 4.3.0) #> knitr 1.46 2024-04-06 [1] RSPM (R 4.3.0) #> lifecycle 1.0.4 2023-11-07 [1] RSPM (R 4.3.0) #> magrittr 2.0.3 2022-03-30 [1] RSPM (R 4.3.0) #> purrr 1.0.2 2023-08-10 [1] RSPM (R 4.3.0) #> R.cache 0.16.0 2022-07-21 [1] RSPM (R 4.3.0) #> R.methodsS3 1.8.2 2022-06-13 [1] RSPM (R 4.3.0) #> R.oo 1.26.0 2024-01-24 [1] RSPM (R 4.3.0) #> R.utils 2.12.3 2023-11-18 [1] CRAN (R 4.3.2) #> Rcpp 1.0.12 2024-01-09 [1] RSPM (R 4.3.0) #> RCurl 1.98-1.14 2024-01-09 [1] RSPM (R 4.3.0) #> reprex 2.1.0 2024-01-11 [1] RSPM (R 4.3.0) #> rlang 1.1.3 2024-01-10 [1] RSPM (R 4.3.0) #> rmarkdown 2.26 2024-03-05 [1] RSPM (R 4.3.0) #> rstudioapi 0.16.0 2024-03-24 [1] RSPM (R 4.3.0) #> sessioninfo 1.2.2 2021-12-06 [1] RSPM (R 4.3.0) #> styler 1.10.3 2024-04-07 [1] RSPM (R 4.3.0) #> terra 1.7-74 2024-03-25 [1] Github (rspatial/terra@290bca1) #> vctrs 0.6.5 2023-12-01 [1] RSPM (R 4.3.0) #> withr 3.0.0 2024-01-16 [1] CRAN (R 4.3.2) #> xfun 0.43 2024-03-25 [1] RSPM (R 4.3.0) #> yaml 2.3.8 2023-12-11 [1] RSPM (R 4.3.0) #> #> [1] /home/frs/R/x86_64-pc-linux-gnu-library/4.0 #> [2] /opt/R/4.3.3/lib/R/library #> #> ────────────────────────────────────────────────────────────────────────────── ```