{"id":13948758,"url":"https://github.com/eliocamp/metR","last_synced_at":"2025-07-20T10:32:38.931Z","repository":{"id":41322360,"uuid":"96357263","full_name":"eliocamp/metR","owner":"eliocamp","description":"Tools for Easier Analysis of Meteorological Fields","archived":false,"fork":false,"pushed_at":"2025-07-07T06:36:29.000Z","size":561890,"stargazers_count":151,"open_issues_count":17,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-12T02:03:44.106Z","etag":null,"topics":["atmospheric-science","ggplot2","r","r-package","rstats","visualization"],"latest_commit_sha":null,"homepage":"https://eliocamp.github.io/metR/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eliocamp.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-07-05T20:09:40.000Z","updated_at":"2025-07-07T06:33:14.000Z","dependencies_parsed_at":"2023-09-21T19:12:12.756Z","dependency_job_id":"df3a2a69-c9b5-44c7-8c75-3f5f0e5d5b7a","html_url":"https://github.com/eliocamp/metR","commit_stats":{"total_commits":1054,"total_committers":5,"mean_commits":210.8,"dds":0.007590132827324458,"last_synced_commit":"1c3d2c3ec16150d5aae4dc35b4e3f60afa3d5b08"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/eliocamp/metR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliocamp%2FmetR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliocamp%2FmetR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliocamp%2FmetR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliocamp%2FmetR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliocamp","download_url":"https://codeload.github.com/eliocamp/metR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliocamp%2FmetR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265236718,"owners_count":23732496,"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":["atmospheric-science","ggplot2","r","r-package","rstats","visualization"],"created_at":"2024-08-08T05:01:29.940Z","updated_at":"2025-07-20T10:32:38.900Z","avatar_url":"https://github.com/eliocamp.png","language":"R","funding_links":[],"categories":["Atmosphere"],"sub_categories":["Meteorological Observation and Forecast"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n    cache = FALSE,\n    collapse = TRUE,\n    comment = \"#\u003e\",\n    fig.path = \"man/figures/\"\n)\nset.seed(42)\n```\n\n# metR \u003cimg src=\"man/figures/logo.png\" align=\"right\"/\u003e\n\n\u003c!-- badges: start --\u003e\n\n[![R-CMD-check](https://github.com/eliocamp/metR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/eliocamp/metR/actions/workflows/R-CMD-check.yaml)\n[![Coverage status](https://codecov.io/gh/eliocamp/metR/branch/master/graph/badge.svg?token=jVznWTMCpz)](https://app.codecov.io/gh/eliocamp/metR)\n[![CRAN status](https://www.r-pkg.org/badges/version/metR)](https://CRAN.R-project.org/package=metR)\n[![DOI](https://zenodo.org/badge/96357263.svg)](https://zenodo.org/badge/latestdoi/96357263)\n\n\u003c!-- badges: end --\u003e\n\nmetR packages several functions and utilities that make R better for handling  meteorological data in the tidy data paradigm. It started mostly sa a packaging of assorted wrappers and tricks that I wrote for my day to day work as a researcher in atmospheric sciences. Since then, it has grown organically and for my own needs and feedback from users. \n\nConceptually it's divided into *visualization tools* and *data tools*. The former are geoms, stats and scales that help with plotting using [ggplot2](https://ggplot2.tidyverse.org/index.html), such as `stat_contour_fill()` or `scale_y_level()`, while the later are functions for common data processing tools in the atmospheric sciences, such as `Derivate()` or `EOF()`; these are implemented to work in the [data.table](https://github.com/Rdatatable/data.table/wiki) paradigm, but also work with regular data frames. \n\nCurrently metR is in development but maturing. Most functions check arguments and there are some tests. However, some functions might change it's interface, and functionality can be moved to other packages, so please bear that in mind. \n\n## Installation\n\nYou can install metR from CRAN with:\n\n```{r CRAN-installation, eval = FALSE}\ninstall.packages(\"metR\")\n```\n\nOr the development version with:\n\n```{r gh-installation, eval = FALSE}\nif (!requireNamespace(\"pak\", quietly = TRUE)) {\n    install.packages(\"pak\")\n}\npak::pak(\"metR\")\n```\n\nIf you need to read netcdf files, you might need to install the netcdf and udunits2 libraries. On Ubuntu and it's derivatives this can be done by typing \n\n```\nsudo apt install libnetcdf-dev netcdf-bin libudunits2-dev\n```\n\n## Citing the package\n\nIf you use metR in your research, please consider citing it. You can get citation information with \n\n```{r}\ncitation(\"metR\")\n```\n\n\n## Examples\n\nIn this example we easily perform Principal Components Decomposition (EOF) on monthly geopotential height, then compute the geostrophic wind associated with this field and plot the field with filled contours and the wind with streamlines.\n\n```{r field}\nlibrary(metR)\nlibrary(data.table)\nlibrary(ggplot2)\ndata(geopotential)\n# Use Empirical Orthogonal Functions to compute the Antarctic Oscillation\ngeopotential \u003c- copy(geopotential)\ngeopotential[, gh.t.w := Anomaly(gh)*sqrt(cos(lat*pi/180)),\n      by = .(lon, lat, month(date))]\naao \u003c- EOF(gh.t.w ~ lat + lon | date, data = geopotential, n = 1)\naao$left[, c(\"u\", \"v\") := GeostrophicWind(gh.t.w/sqrt(cos(lat*pi/180)), \n                                                    lon, lat)]\n\n# AAO field\nbinwidth \u003c- 0.01\nggplot(aao$left, aes(lon, lat)) +\n    geom_contour_fill(aes(z = gh.t.w/sqrt(cos(lat*pi/180)), \n                          fill = after_stat(level)), binwidth = binwidth,\n                      xwrap = c(0, 360)) +\n    geom_streamline(aes(dx = dlon(u, lat), dy = dlat(v)),\n                    linewidth = 0.4, L = 80, skip = 3, xwrap = c(0, 360)) +\n    scale_x_longitude() +\n    scale_y_latitude(limits = c(-90, -20)) +\n    scale_fill_divergent_discretised(name = \"AAO pattern\") +\n    coord_polar()\n```\n\n```{r timeseries}\n# AAO signal\nggplot(aao$right, aes(date, gh.t.w)) +\n    geom_line() +\n    geom_smooth(span = 0.4)\n```\n\nYou can read more in the vignettes: [Visualization tools](https://eliocamp.github.io/metR/articles/Visualization-tools.html) and [Working with data](https://eliocamp.github.io/metR/articles/Working-with-data.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliocamp%2FmetR","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliocamp%2FmetR","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliocamp%2FmetR/lists"}