metR

Several functions and utilities that make R better for handling meteorological data in the tidy data paradigm.
https://github.com/eliocamp/metR

Category: Atmosphere
Sub Category: Meteorological Observation and Forecast

Keywords

atmospheric-science ggplot2 r r-package rstats visualization

Keywords from Contributors

visualisation

Last synced: about 19 hours ago
JSON representation

Repository metadata

Tools for Easier Analysis of Meteorological Fields

README.md

metR

R-CMD-check
Codecov test coverage
CRAN status
DOI

metR 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.

Conceptually it’s divided into visualization tools and data tools.
The former are geoms, stats and scales that help with plotting using
ggplot2, 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 paradigm,
but also work with regular data frames.

Currently 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.

Installation

You can install metR from CRAN with:

install.packages("metR")

Or the development version with:

if (!requireNamespace("pak", quietly = TRUE)) {
    install.packages("pak")
}
pak::pak("metR")

If 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

sudo apt install libnetcdf-dev netcdf-bin libudunits2-dev

Citing the package

If you use metR in your research, please consider citing it. You can get
citation information with

citation("metR")
#> To cite metR in publications use:
#> 
#> 
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Manual{,
#>     title = {metR: Tools for Easier Analysis of Meteorological Fields},
#>     author = {Elio Campitelli},
#>     year = {2021},
#>     note = {R package version 0.19.0},
#>     url = {https://eliocamp.github.io/metR/},
#>     doi = {10.5281/zenodo.2593516},
#>   }

Examples

In 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.

library(metR)
library(data.table)
#> 
#> Attaching package: 'data.table'
#> The following object is masked from 'package:base':
#> 
#>     %notin%
library(ggplot2)
data(geopotential)
# Use Empirical Orthogonal Functions to compute the Antarctic Oscillation
geopotential <- copy(geopotential)
geopotential[, gh.t.w := Anomaly(gh)*sqrt(cos(lat*pi/180)),
      by = .(lon, lat, month(date))]
aao <- EOF(gh.t.w ~ lat + lon | date, data = geopotential, n = 1)
aao$left[, c("u", "v") := GeostrophicWind(gh.t.w/sqrt(cos(lat*pi/180)), 
                                                    lon, lat)]

# AAO field
binwidth <- 0.01
ggplot(aao$left, aes(lon, lat)) +
    geom_contour_fill(aes(z = gh.t.w/sqrt(cos(lat*pi/180)), 
                          fill = after_stat(level)), binwidth = binwidth,
                      xwrap = c(0, 360)) +
    geom_streamline(aes(dx = dlon(u, lat), dy = dlat(v)),
                    linewidth = 0.4, L = 80, skip = 3, xwrap = c(0, 360)) +
    scale_x_longitude() +
    scale_y_latitude(limits = c(-90, -20)) +
    scale_fill_divergent_discretised(name = "AAO pattern") +
    coord_polar()
#> Warning in .check_wrap_param(list(...)): 'xwrap' and 'ywrap' will be
#> deprecated. Use ggperiodic::periodic insead.

# AAO signal
ggplot(aao$right, aes(date, gh.t.w)) +
    geom_line() +
    geom_smooth(span = 0.4)
#> `geom_smooth()` using method = 'loess' and formula = 'y ~ x'

You can read more in the vignettes: Visualization
tools

and Working with
data
.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 3 days ago

Total Commits: 1,171
Total Committers: 8
Avg Commits per committer: 146.375
Development Distribution Score (DDS): 0.021

Commits in past year: 51
Committers in past year: 3
Avg Commits per committer in past year: 17.0
Development Distribution Score (DDS) in past year: 0.157

Name Email Commits
Elio Campitelli e****i@g****m 1146
Teun van den Brand 4****d 10
Breeze-Hu 1****7@q****m 7
olivroy o****1@h****m 4
Paul Murrell p****l@s****z 1
Paola Corrales p****s 1
Matt 3****r 1
Hadley Wickham h****m@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 193
Total pull requests: 24
Average time to close issues: 6 months
Average time to close pull requests: 14 days
Total issue authors: 49
Total pull request authors: 9
Average comments per issue: 1.07
Average comments per pull request: 0.96
Merged pull request: 14
Bot issues: 0
Bot pull requests: 0

Past year issues: 4
Past year pull requests: 2
Past year average time to close issues: 14 days
Past year average time to close pull requests: 2 months
Past year issue authors: 3
Past year pull request authors: 2
Past year average comments per issue: 1.25
Past year average comments per pull request: 1.5
Past year merged pull request: 2
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/eliocamp/metR

Top Issue Authors

  • eliocamp (120)
  • paocorrales (6)
  • pascaloettli (5)
  • lemuscanovas (5)
  • fipoucat (4)
  • m-saenger (3)
  • chrisdane (3)
  • PanfengZhang (3)
  • Breeze-Hu (2)
  • delie0512 (2)
  • rsbivand (2)
  • galenholt (1)
  • schckngs (1)
  • symbalex (1)
  • WMueller11 (1)

Top Pull Request Authors

  • eliocamp (10)
  • teunbrand (4)
  • olivroy (4)
  • raymondben (1)
  • m-saenger (1)
  • paocorrales (1)
  • hadley (1)
  • pmur002 (1)
  • Breeze-Hu (1)

Top Issue Labels

  • enhancement (27)
  • bug (11)
  • Derivatives (4)
  • decision (3)
  • questionable (3)
  • reprex needed (1)

Top Pull Request Labels

  • hacktoberfest-accepted (1)

Package metadata

cran.r-project.org: metR

Tools for Easier Analysis of Meteorological Fields

  • Homepage: https://eliocamp.github.io/metR/
  • Documentation: http://cran.r-project.org/web/packages/metR/metR.pdf
  • Licenses: GPL-3
  • Latest release: 0.19.0 (published about 1 month ago)
  • Last Synced: 2026-11-13T14:31:38.292Z (2 days ago)
  • Versions: 24
  • Dependent Packages: 21
  • Dependent Repositories: 31
  • Downloads: 5,906 Last month
  • Docker Downloads: 42,058
  • Rankings:
    • Stargazers count: 3.083%
    • Dependent packages count: 3.45%
    • Forks count: 3.518%
    • Average: 4.43%
    • Dependent repos count: 4.838%
    • Downloads: 7.259%
  • Maintainers (1)
proxy.golang.org: github.com/eliocamp/metr

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/eliocamp/metr#section-documentation
  • Licenses:
  • Latest release: v0.19.0 (published about 1 month ago)
  • Last Synced: 2026-11-13T14:31:51.915Z (2 days ago)
  • Versions: 22
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 5.459%
    • Average: 5.642%
    • Dependent repos count: 5.825%
proxy.golang.org: github.com/eliocamp/metR

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/eliocamp/metR#section-documentation
  • Licenses:
  • Latest release: v0.19.0 (published about 1 month ago)
  • Last Synced: 2026-11-13T14:31:59.880Z (2 days ago)
  • Versions: 22
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 5.459%
    • Average: 5.642%
    • Dependent repos count: 5.825%
conda-forge.org: r-metr

  • Homepage: https://github.com/eliocamp/metR
  • Licenses: GPL-3.0-only
  • Latest release: 0.13.0 (published about 4 years ago)
  • Last Synced: 2026-07-24T19:58:10.310Z (4 months ago)
  • Versions: 13
  • Dependent Packages: 2
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 19.506%
    • Stargazers count: 28.45%
    • Average: 29.179%
    • Dependent repos count: 34.025%
    • Forks count: 34.734%

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • Formula * imports
  • RCurl * imports
  • checkmate * imports
  • data.table * imports
  • digest * imports
  • fields * imports
  • formula.tools * imports
  • ggplot2 >= 3.0.0 imports
  • grid * imports
  • gtable * imports
  • isoband * imports
  • lubridate * imports
  • memoise * imports
  • plyr * imports
  • purrr * imports
  • scales * imports
  • sp * imports
  • stringr * imports
  • PCICt * suggests
  • covr * suggests
  • gridExtra * suggests
  • here * suggests
  • irlba * suggests
  • knitr * suggests
  • kriging * suggests
  • maps * suggests
  • maptools * suggests
  • ncdf4 * suggests
  • pkgdown * suggests
  • proj4 * suggests
  • raster * suggests
  • reshape2 * suggests
  • rgdal * suggests
  • rmarkdown * suggests
  • testthat >= 2.1.0 suggests
  • udunits2 * suggests
  • vdiffr * suggests
  • viridis * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/pkgdown.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/revdepcheck.yaml actions
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • codecov/codecov-action v5 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite

Score: 18.035047439185345