-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
98 lines (70 loc) · 2.82 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# HPBdata
<!-- badges: start -->
[![R-CMD-check](https://github.com/dimfalk/HPBdata/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dimfalk/HPBdata/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/dimfalk/HPBdata/graph/badge.svg?token=AQDHB9XQDO)](https://codecov.io/gh/dimfalk/HPBdata)
<!-- badges: end -->
HPBdata aims to provide access to historical meteorological measurements at
various temporal resolutions (1 min, 10 min, 1 day) obtained at 'Hohenpeißenberg'
site (Bavaria, Germany). Data was acquired from the [Climate Data Center](https://opendata.dwd.de/climate_environment/CDC/observations_germany/climate)
hosted by the German Weather Service and has been coverted to `{xts}` objects
for subsequent applications in need of representative meteorological measurements.
Since I found myself in the need of a meteorological measurement sample dataset
for climatological evaluations, meteorological calculations, extreme value
statistics, etc quite often, I decided to assemble needed data in order to
simplify package development in the future.
## Installation
You can install the development version of HPBdata with:
``` r
# install.packages("devtools")
devtools::install_github("dimfalk/HPBdata")
```
and load the package via
```{r}
library(HPBdata)
```
## Getting started
There is not really much to say about the use. HPBdata is a data-only package
without any functions provided consisting of three objects:
`obs_1min`, `obs_10min` and `obs_1d`.
These are named lists of different length containing xts objects of different
length at specified interval width for various meteorological parameters.
For details, it is strongly encouraged to study the dataset documentation
provided, e.g. `?obs_10min`, and the official dataset description linked there.
```{r example}
# inspect superordinate list
class(obs_10min)
length(obs_10min)
names(obs_10min)
# inspect xts objects contained
class(obs_10min[["TT_10"]])
length(obs_10min[["TT_10"]])
```
As a little remark worth noting, the xts objects contained are provided with
some additional metadata appended in form of attributes based on a data model
implemented in `{timeseriesIO}` to ensure I/O compatibility:
```{r}
attributes(obs_10min[["TT_10"]])[5:22]
```
Other than that, you can now just leverage all the sweet xts functionality:
```{r, warning = FALSE}
library(xts)
# subsetting
x <- obs_10min[["TT_10"]]["2022"]
x
# aggregating
xts::apply.monthly(x, "mean", na.rm = TRUE) |> round(1)
# plotting
plot(x, ylab = "air temperature at 2 m [°C]", col = "red", main = "02290 Hohenpeißenberg")
```