changing the date column to the format required by the openair package
df$date <- as.POSIXct(df$Date, tz = "UTC")
df <- merge(df, wdir, by= "ddd", all.x = TRUE) # joining two datasets
df$ws <- df$ffkmh/3.6 # converting to m/s from km/h
df$gust <- df$Gustkmh/3.6 # converting to m/s from km/h
windRose(mydata = df, ws = "ws", wd = "dir", type = "season", paddle = FALSE,
main = "Svalbard Lufthavn (2018)", ws.int = 3, dig.lab = 3, layout = c(4, 1))
```
**Figure 2.** Seasonal wind roses for Svalbard Lufthavn in 2018 based on Ogimet dataset.

#### 3.1.1. Searching for the Nearest Stations

The user can also use the climate package without knowing the station's WMO ID. The nearest synoptic stations can be found with the nearest\_ogimet\_stations function (Listing 3). It requires users to provide a pair of geographical coordinates that point to the centroid of our area of investigations. We can specify how many nearest meteorological stations an user wants to find. As a result, we get a data frame with stations metadata and distance to given coordinates. Additionally a simple map can be added with the argument add\_map = TRUE. Exemplary results and the code is given below Figure 3.

**Listing 3.** Example of downloading nearest stations according to a specified location (first six nearest stations are shown).

```
library(climate)
ns = nearest_stations_ogimet(country = "United+Kingdom", point = c(-4, 56),
no_of_stations = 50, add_map = TRUE)
head(ns)
#> wmo_id station_names lon lat alt distance [km]
#> 29 03144 Strathallan -3.733348 56.31667 35 46.44794
#> 32 03155 Drumalbin -3.733348 55.61668 245 52.38975
#> 30 03148 Glen Ogle -4.316673 56.41667 564 58.71862
#> 27 03134 Glasgow Bishopton -4.533344 55.90002 59 60.88179
#> 35 03166 Edinburgh Gogarbank -3.350007 55.93335 57 73.30942
#> 28 03136 Prestwick RNAS -4.583345 55.51668 26 84.99537
```
**Figure 3.** Example code for searching for the 50 nearest stations from the point of given coordinates (longitude 5° W, latitude 56° N) in United Kingdom. First 22 records are shown in Listing 3.

#### *3.2. Sounding Data—Use Case*

Downloading data for a single vertical profile of the atmosphere requires providing date, hour, and station's name (Listing 4). The chosen use case showed an atmospheric sounding started at 00UTC on 4th April 2019 in Łeba, Poland (Figure 4). The returned data frame from the measurements allowed users to plot temperature and humidity profiles on the Skew-T diagram generated thanks to the RadioSonde package [26]. It showed a strong thermal inversion up to 800–850 m a.g.l. which may strongly impact the air quality conditions in a near-surface layers [24]. The metadata and thermodynamic calculations stored in the second element of the returned list were omitted on purpose as no severe weather parameters related to atmospheric convection were detected.

**Listing 4.** Example of code to download sounding data, with Skew-T diagram.

```
library(climate)
library(RadioSonde) # an external package
profile <- sounding_wyoming(wmo_id = 12120,yy = 2019, mm = 4, dd = 4, hh = 0)
df <- profile[[1]]
colnames(df)[c(1, 3:4)] = c("press", "temp", "dewpt") # changing column names
RadioSonde::plotsonde(df, winds = FALSE, title = "2019-04-04 00UTC (LEBA, PL)",
col = c("red", "blue"), lwd = 3)
```
**Figure 4.** Example of a downloaded sounding dataset plotted on Skew-T diagram.

#### *3.3. IMGW-PIB—Use Case*

Another use case shows the possibilities of the climate package when coupled with the GIS and statistical capabilities of the R programming language (Figure 5). The downloaded data comprised 30 years of monthly mean air temperatures derived from the main meteorological stations in Poland. Due to the missing or suspicious diagnosed values, some data were excluded, e.g., stations' location changes during the analyzed period or having a monthly mean air temperature during the summer season of 0 °C. The next step was to create a function for calculating the slope coefficient of the linear regression model that was later applied to the whole dataset.

**Figure 5.** Air temperature trends in Poland per 100 years (◦C) based on the calculated slope of linear regression for 1978-2017—IMGW-PIB dataset.

The obtained results (Listing 5) were later transformed into a spatial object using the sf package [27] and visualized in the form of the map using the tmap package [28]. The created vector layer can later be saved in any GIS format supported by the sf package interfacing between R and the geospatial data abstraction library drivers (GDAL). One of the major advantages of using the R programming language is being able to keep everything in one environment instead of the typical situation where three different tools are applied for (1) data preprocessing, (2) statistical analysis, and (3) spatial data visualization. Such an approach makes it possible to reduce the required time for the entire research significantly and to focus more on the obtained results. However, the user must be aware that the provided tool is only an interface for downloading the data, and that the obtained results may inherit errors from the source repositories.

**Listing 5.** Exemplary code for downloading, processing and visualizing data from the IMGW-PIB repository.

```
library(ggplot2)
library(dplyr)
library(tidyr)
library(sf)
library(tmap)
library(rnaturalearth)
library(climate)
ms <- meteo_imgw("monthly", "synop", year = 1978:2017, coords = TRUE)