Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Pakillo opened this issue Apr 16, 2024 · 0 comments
Open

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

Pakillo opened this issue Apr 16, 2024 · 0 comments

Comments

@Pakillo
Copy link
Collaborator

Pakillo commented Apr 16, 2024

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
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
#> 
#> ──────────────────────────────────────────────────────────────────────────────
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant