/
api_metadata.Rmd
97 lines (75 loc) · 1.95 KB
/
api_metadata.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
---
title: "AEMET API Metadata"
date: "`r Sys.Date()`"
---
```{r knitropts, include=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
tidy = "styler",
warning = FALSE,
message = FALSE
)
```
The following table shows the metadata provided by AEMET for each of the
functions included on **climaemet** (Last update:
**`r format(Sys.Date(),"%d-%B-%Y")`**).
```{r reactable, echo=FALSE, warning = FALSE, message=FALSE}
# Get all the metadata
library(dplyr)
library(climaemet)
daily <- aemet_daily_clim(extract_metadata = TRUE)$campos
daily$fun <- "aemet_daily"
exend <- lapply(c("T", "P", "V"), function(x) {
ex <- aemet_extremes_clim("9434",
parameter = x,
extract_metadata = TRUE
)$campos
ex$fun <- "aemet_extremes"
ex
}) %>%
bind_rows() %>%
distinct()
fday <- aemet_forecast_daily("08001", extract_metadata = TRUE)$campos
fday$fun <- "aemet_forecast_daily"
fhour <- aemet_forecast_hourly("08001", extract_metadata = TRUE)$campos
fhour$fun <- "aemet_forecast_hourly"
lobs <- aemet_last_obs(extract_metadata = TRUE)$campos
lobs$fun <- "aemet_last_obs"
mon <- aemet_monthly_period(
station = "9434", start = 2022,
extract_metadata = TRUE
)$campos
mon$fun <- "aemet_monthly"
norm <- aemet_normal_clim_all(extract_metadata = TRUE)$campos
norm$fun <- "aemet_normal"
end <- daily %>%
bind_rows(exend, fday, fhour, lobs, mon, norm) %>%
relocate(fun, .before = 1) %>%
as_tibble() %>%
distinct_all()
library(reactable)
reactable::reactable(end,
filterable = TRUE,
searchable = TRUE,
showPageSizeOptions = TRUE,
striped = TRUE,
paginationType = "jump",
defaultPageSize = 20,
compact = TRUE,
elementId = "aemet-metadata",
columns = list(
fun = colDef(name = "function / family", style = "font-weight:bold;")
)
)
```
## Session info
<details>
<summary>Details</summary>
```{r session, echo=FALSE}
if (!require("sessioninfo")) {
install.packages("sessioninfo")
}
sessioninfo::session_info()
```
</details>