get_meta.Rmd 966 Bytes
Newer Older
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
title: "get_meta"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{get_meta}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include = FALSE}
library(frostr)
knitr::opts_chunk$set(collapse = T, comment = "#>")
```

## Get easily metadata


```R

Jean-Marie Lepioufle's avatar
typo    
Jean-Marie Lepioufle committed
20
21
22
23
id <- "your id"
frostr <- frostr::api(httpauth = 1,userpwd=paste0(id,":"))


Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
stations <- "SN18700"

stn_meta <- frostr::get_short_meta_station(frostObj=frostr,stations=stations)


west <- 10
south <- 60
north <- 65
east <- 11

stn_meta <- frostr::get_short_meta_station(frostObj=frostr,stations=stations,west=west,south=south,east=east,north=north)

elements <- c("sum(precipitation_amount PT1H)")

ele_meta <- get_short_meta_element(frostObj=frostr,elements=elements)
res <- dplyr::inner_join(stn_meta,ele_meta)

# or quicker
res <- frostr::get_short_meta_station_with_element(frostObj=frostr,west=west,south=south,east=east,north=north,elements=elements)

```