{"id":13948884,"url":"https://github.com/rOpenSpain/climaemet","last_synced_at":"2025-07-20T10:32:56.590Z","repository":{"id":40235547,"uuid":"277600874","full_name":"rOpenSpain/climaemet","owner":"rOpenSpain","description":"R Climate AEMET Tools","archived":false,"fork":false,"pushed_at":"2025-06-25T14:48:34.000Z","size":641965,"stargazers_count":43,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-10T06:51:18.370Z","etag":null,"topics":["aemet","climate","cran","data","forecast-api","r","r-package","ropenspain","rstats","science","spain","weather-api"],"latest_commit_sha":null,"homepage":"https://ropenspain.github.io/climaemet/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rOpenSpain.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":null}},"created_at":"2020-07-06T17:02:11.000Z","updated_at":"2025-06-24T19:08:56.000Z","dependencies_parsed_at":"2023-09-21T19:31:28.340Z","dependency_job_id":"7403e9fc-7989-475a-9053-3a0f0356c008","html_url":"https://github.com/rOpenSpain/climaemet","commit_stats":{"total_commits":304,"total_committers":7,"mean_commits":43.42857142857143,"dds":0.2203947368421053,"last_synced_commit":"4fbc025614d3dc907238b0f8739b40c07c22070e"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/rOpenSpain/climaemet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenSpain%2Fclimaemet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenSpain%2Fclimaemet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenSpain%2Fclimaemet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenSpain%2Fclimaemet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rOpenSpain","download_url":"https://codeload.github.com/rOpenSpain/climaemet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenSpain%2Fclimaemet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264929328,"owners_count":23684788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aemet","climate","cran","data","forecast-api","r","r-package","ropenspain","rstats","science","spain","weather-api"],"created_at":"2024-08-08T05:01:33.441Z","updated_at":"2025-07-20T10:32:56.576Z","avatar_url":"https://github.com/rOpenSpain.png","language":"R","funding_links":[],"categories":["Climate Change","Meteorología"],"sub_categories":["Climate Data Access and Visualization","Wallapop"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r knitr, include=FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  message = FALSE,\n  warning = FALSE,\n  dev = \"ragg_png\",\n  tidy = \"styler\",\n  comment = \"#\u003e\",\n  dpi = 300,\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# climaemet \u003cimg src=\"man/figures/logo.png\" align=\"right\" width=\"120\"/\u003e\n\n\u003c!-- badges: start --\u003e\n\n[![rOS-badge](https://ropenspain.github.io/rostemplate/reference/figures/ropenspain-badge.svg)](https://ropenspain.es/)\n[![CRAN\nstatus](https://www.r-pkg.org/badges/version/climaemet)](https://CRAN.R-project.org/package=climaemet)\n[![CRAN_time_from_release](https://www.r-pkg.org/badges/ago/climaemet)](https://cran.r-project.org/package=climaemet)\n[![CRAN_latest_release_date](https://www.r-pkg.org/badges/last-release/climaemet)](https://cran.r-project.org/package=climaemet)\n[![CRAN\nresults](https://badges.cranchecks.info/worst/climaemet.svg)](https://cran.r-project.org/web/checks/check_results_climaemet.html)\n[![r-universe](https://ropenspain.r-universe.dev/badges/climaemet)](https://ropenspain.r-universe.dev/climaemet)\n[![R-CMD-check](https://github.com/rOpenSpain/climaemet/actions/workflows/roscron-check-full.yaml/badge.svg)](https://github.com/rOpenSpain/climaemet/actions/workflows/roscron-check-full.yaml)\n[![R-hub](https://github.com/rOpenSpain/climaemet/actions/workflows/rhub.yaml/badge.svg)](https://github.com/rOpenSpain/climaemet/actions/workflows/rhub.yaml)\n[![codecov](https://codecov.io/gh/rOpenSpain/climaemet/graph/badge.svg?token=ZD3FL138Z4)](https://app.codecov.io/gh/rOpenSpain/climaemet)\n[![DOI](https://img.shields.io/badge/DOI-10.32614/CRAN.package.climaemet-blue)](https://doi.org/10.32614/CRAN.package.climaemet)\n[![metacran\ndownloads](https://cranlogs.r-pkg.org/badges/climaemet)](https://cran.r-project.org/package=climaemet)\n![GitHub\nLicense](https://img.shields.io/github/license/ropenspain/climaemet?color=blue)\n[![Project Status: Active -- The project has reached a stable, usable state and\nis being actively\ndeveloped.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n\n\u003c!-- badges: end --\u003e\n\nThe goal of **climaemet** is to serve as an interface to download the climatic\ndata of the Spanish Meteorological Agency (AEMET) directly from R using their\n[API](https://opendata.aemet.es/) and create scientific graphs (climate charts,\ntrend analysis of climate time series, temperature and precipitation anomalies\nmaps, \"warming stripes\" graphics, climatograms, etc.).\n\nBrowse manual and vignettes at \u003chttps://ropenspain.github.io/climaemet/\u003e.\n\n## AEMET Open Data\n\nAEMET OpenData is a REST API developed by AEMET that allows the dissemination\nand reuse of the Agency's meteorological and climatological information. To see\nmore details visit: \u003chttps://opendata.aemet.es/centrodedescargas/inicio\u003e\n\n## License for the original data\n\nInformation prepared by the Spanish Meteorological Agency (© AEMET). You can\nread about it [here](https://www.aemet.es/en/nota_legal).\n\nA summary for the usage of the data could be interpreted as:\n\n\u003e People can use freely this data. You should mention AEMET as the collector of\n\u003e the original data in every situation except if you are using this data\n\u003e privately and individually. AEMET makes no warranty as to the accuracy or\n\u003e completeness of the data. All data are provided on an \"as is\" basis. AEMET is\n\u003e not responsible for any damage or loss derived from the interpretation or use\n\u003e of this data.\n\n## Installation\n\nYou can install the released version of **climaemet** from\n[CRAN](https://CRAN.R-project.org) with:\n\n```{r, eval=FALSE}\ninstall.packages(\"climaemet\")\n```\n\nYou can install the developing version of **climaemet** using the\n[r-universe](https://ropenspain.r-universe.dev/climaemet):\n\n```{r, eval=FALSE}\n# Install climaemet in R:\ninstall.packages(\"climaemet\",\n  repos = c(\"https://ropenspain.r-universe.dev\", \"https://cloud.r-project.org\")\n)\n```\n\nAlternatively, you can install the developing version of **climaemet** with:\n\n```{r, eval=FALSE}\n# install.packages(\"pak\")\npak::pak(\"ropenspain/climaemet\")\n```\n\n## API key\n\nTo be able to download data from AEMET you will need a free API key which you\ncan get [here](https://opendata.aemet.es/centrodedescargas/obtencionAPIKey).\n\n```{r, eval=FALSE}\nlibrary(climaemet)\n\n## Get api key from AEMET\nbrowseURL(\"https://opendata.aemet.es/centrodedescargas/obtencionAPIKey\")\n\n## Use this function to register your API Key temporarly or permanently\naemet_api_key(\"MY API KEY\")\n```\n\n## Changes on v1.0.0!\n\nNow the `apikey` parameter on the functions have been deprecated. You may need\nto set your API Key globally using `aemet_api_key()`. Note that you would need\nalso to remove the `apikey` parameter on your old codes.\n\n### Now **climaemet** is tidy...\n\nFrom `v1.0.0` onward, **climaemet** provides its results in [`tibble`\nformat](https://tibble.tidyverse.org/). Also, the functions try to guess the\ncorrect format of the fields (i.e. something as a Date/Hour now is an hour,\nnumbers are parsed as double, etc.).\n\n```{r tibble, message=TRUE}\nlibrary(climaemet)\n\n# See a tibble in action\n\naemet_last_obs(\"9434\")\n```\n\n### ... and spatial!\n\nAnother major change in `v1.0.0` is the ability of return information on spatial\n`sf` format, using `return_sf = TRUE`. The coordinate reference system (CRS)\nused is **EPSG 4326**, that correspond to the **World Geodetic System (WGS)**\nand return coordinates in latitude/longitude (unprojected coordinates):\n\n```{r spatial}\n# You would need to install `sf` if not installed yet\n# run install.packages(\"sf\") for installation\n\nlibrary(ggplot2)\nlibrary(dplyr)\n\nall_stations \u003c- aemet_daily_clim(\n  start = \"2021-01-08\", end = \"2021-01-08\",\n  return_sf = TRUE\n)\n\n\nggplot(all_stations) +\n  geom_sf(aes(colour = tmed), shape = 19, size = 2, alpha = 0.95) +\n  labs(\n    title = \"Average temperature in Spain\",\n    subtitle = \"8 Jan 2021\",\n    color = \"Max temp.\\n(celsius)\",\n    caption = \"Source: AEMET\"\n  ) +\n  scale_colour_gradientn(\n    colours = hcl.colors(10, \"RdBu\", rev = TRUE),\n    breaks = c(-10, -5, 0, 5, 10, 15, 20),\n    guide = \"legend\"\n  ) +\n  theme_bw() +\n  theme(\n    panel.border = element_blank(),\n    plot.title = element_text(face = \"bold\"),\n    plot.subtitle = element_text(face = \"italic\")\n  )\n```\n\n## Plots\n\nWe can also draw a \"warming stripes\" graph with the downloaded data from a\nweather station. These functions returns **ggplot2** plots:\n\n```{r climatestripes, fig.asp=0.7, eval=TRUE}\n# Plot a climate stripes graph for a period of years for a station\n\nlibrary(ggplot2)\n\n# Example data\ntemp_data \u003c- climaemet::climaemet_9434_temp\n\nggstripes(temp_data, plot_title = \"Zaragoza Airport\") +\n  labs(subtitle = \"(1950-2020)\")\n```\n\nFurthermore, we can draw the well-known Walter \u0026 Lieth climatic diagram for a\nweather station and over a specified period of time:\n\n```{r climatogram, fig.asp=0.7, eval=TRUE}\n# Plot of a Walter \u0026 Lieth climatic diagram for a station\n\n# Example data\nwl_data \u003c- climaemet::climaemet_9434_climatogram\n\nggclimat_walter_lieth(wl_data,\n  alt = \"249\", per = \"1981-2010\",\n  est = \"Zaragoza Airport\"\n)\n```\n\nAdditionally, we may be interested in drawing the wind speed and direction over\na period of time for the data downloaded from a weather station.:\n\n```{r windrose, fig.asp=0.7, eval=TRUE}\n# Plot a windrose showing the wind speed and direction for a station\n\n# Example data\nwind_data \u003c- climaemet::climaemet_9434_wind\n\nspeed \u003c- wind_data$velmedia\ndirection \u003c- wind_data$dir\n\nggwindrose(\n  speed = speed, direction = direction,\n  speed_cuts = seq(0, 16, 4), legend_title = \"Wind speed (m/s)\",\n  calm_wind = 0, n_col = 1, plot_title = \"Zaragoza Airport\"\n) +\n  labs(subtitle = \"2000-2020\", caption = \"Source: AEMET\")\n```\n\n## Code of Conduct\n\nPlease note that this project is released with a Contributor Code of Conduct. By\nparticipating in this project you agree to abide by its terms.\n\n## Citation\n\nUsing **climaemet** for a paper you are writing?. Consider citing it:\n\n```{r echo=FALSE, results='asis'}\nprint(citation(\"climaemet\")[1], style = \"html\")\n```\n\nA BibTeX entry for LaTeX users is:\n\n```{r echo=FALSE, comment=''}\ntoBibtex(citation(\"climaemet\")[1])\n```\n\n## Links\n\n-   Download from CRAN at \u003chttps://cran.r-project.org/package=climaemet\u003e\n-   Browse source code at \u003chttps://github.com/ropenspain/climaemet\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FrOpenSpain%2Fclimaemet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FrOpenSpain%2Fclimaemet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FrOpenSpain%2Fclimaemet/lists"}