Skip to content

Commit

Permalink
documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
GregorDeCillia committed Sep 17, 2020
1 parent 2c7c6da commit 1158d37
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
12 changes: 7 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ save a json file on your local file system.
Provide the path to the downloaded file in `sc_get_response()`.

``` r
my_response <- sc_get_response("pfad/zu/api_abfrage.json")
my_response <- sc_get_response("path/to/api_request.json")
```

The object `my_response` contains the raw API response from `httr::post()`.
Expand All @@ -79,7 +79,7 @@ as.array(my_response)
as.data.frame(my_response)
```

This will produce a tidy table, which contains a column for each dimension
This will produce a tidy table, which contains a column for each field
of the table. Furthermore, two columns will be present for each measure

```{r}
Expand All @@ -94,8 +94,10 @@ function `sc_annotation_legend()`.
sc_annotation_legend(my_response)
```

In this case, we see that row 21 contains a value `NA` (**N**ot **A**vailable) because the value is not provided. However, the zero value in row 20 can be
considered a "real zero value" because no annotations are provided.
In this case, we see that row 21 contains a value `NA` (**N**ot **A**vailable)
because the value is not disclosed ("Verkreuzung nicht erlaubt"). However, the
zero value in row 20 can be considered a "real zero value" because no
annotations are provided.

## Usecase: Saved Table

Expand Down Expand Up @@ -152,7 +154,7 @@ STATcubeR:::sc_get_schema() %>% httr::content()
STATcubeR:::sc_get_rate_limit() %>% httr::content()
```

STATcube uses caching for the table endpoint by default. If the same
STATcube uses caching for the `/table` endpoint by default. If the same
request to `sc_get_response()` is sent several times, this will not count
towards the rate-limit (100 requests per hour).

Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ will save a json file on your local file system.
Provide the path to the downloaded file in `sc_get_response()`.

``` r
my_response <- sc_get_response("pfad/zu/api_abfrage.json")
my_response <- sc_get_response("path/to/api_request.json")
```

The object `my_response` contains the raw API response from
Expand Down Expand Up @@ -79,9 +79,8 @@ as.array(my_response)
as.data.frame(my_response)
```

This will produce a tidy table, which contains a column for each
dimension of the table. Furthermore, two columns will be present for
each measure
This will produce a tidy table, which contains a column for each field
of the table. Furthermore, two columns will be present for each measure

``` r
as.data.frame(my_response) %>% .[c(1:4, 19:24), ]
Expand Down Expand Up @@ -112,9 +111,9 @@ sc_annotation_legend(my_response)
```

In this case, we see that row 21 contains a value `NA` (**N**ot
**A**vailable) because the value is not provided. However, the zero
value in row 20 can be considered a “real zero value” because no
annotations are provided.
**A**vailable) because the value is not disclosed (“Verkreuzung nicht
erlaubt”). However, the zero value in row 20 can be considered a “real
zero value” because no annotations are provided.

## Usecase: Saved Table

Expand Down Expand Up @@ -195,7 +194,7 @@ STATcubeR:::sc_get_schema() %>% httr::content()
STATcubeR:::sc_get_rate_limit() %>% httr::content()
```

STATcube uses caching for the table endpoint by default. If the same
STATcube uses caching for the `/table` endpoint by default. If the same
request to `sc_get_response()` is sent several times, this will not
count towards the rate-limit (100 requests per hour).

Expand Down
7 changes: 7 additions & 0 deletions vignettes/articles/Setup.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ sc_token_set("XXXX")
#>
#> to your .Renviron to set the token persistently
```

## How do I get an API token?

Currently, the api is only available inside the firewall of statistics austria.
Therefore, api tokens can only be requested by our employees. Api access for
external users with a statcube subscription is planned for spring 2021. Please
get into contact with the package maintainers of `STATcubeR` for details.

0 comments on commit 1158d37

Please sign in to comment.