Skip to content

Commit

Permalink
fix vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
yannikbuhl committed Jan 3, 2025
1 parent 5596bab commit f141a65
Showing 1 changed file with 13 additions and 41 deletions.
54 changes: 13 additions & 41 deletions vignettes/additional_parameter.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ library(restatis)

## Information

This is a brief overview of the additional parameters for an API call via {restatis}. These parameters only affect the API call itself, not the data processing. Be aware: Not all parameters are available for all functions.
This is a brief overview of the additional parameters for an API call via {restatis}. These parameters are offered by some of the API endpoints of the three databases, but {restatis} does not explicitly offer them as function parameters. We do, however, provide the possibility of passing additional parameters to most functions via the '...' notation. These parameters are then added to the API call and affect it in the -hopefully- intended way. However, they have no other effect (e.g., on data processing) and there is no error handling implemented for them. It is the user's responsibility to provide correct parameter names and parameter values. Be aware: Not all parameters are available for all functions.

Especially `gen_table()` and `gen_cube()` have a lot of different additional parameters to specify the API call. For a detailed overview, see the following official documents:

- The GENESIS database: https://www-genesis.destatis.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf
- The GENESIS database: https://www-genesis.destatis.de/datenbank/online/docs/GENESIS-Webservices_Einfuehrung.pdf
- The Zensus 2022 database: https://ergebnisse.zensus2022.de/datenbank/online/docs/ZENSUS-Webservices_Einfuehrung.pdf
- regionalstatistik.de: https://www.regionalstatistik.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf

## Short Overview of the Most Used Additional Parameters

### Parameter: Selection & Searchcriterion

The `selection` parameter is a string that specifies the filter to use for filtering the API call. The criterion to which this parameter is applied to is defined by the `searchcriterion` parameter. The maximum length of the string depends on the function being used, but often times varies between 10 and 15 characters. It is possible to use '\*' as a placeholder. The default for this parameter is *no* filtering.
The `selection` parameter is a string that specifies the filter to use for filtering the API call. The criterion to which this parameter is applied to is defined by the `searchcriterion` parameter. The maximum length of the string depends on the function being used, but oftentimes varies between 10 and 15 characters. It is possible to use '\*' as a placeholder. The default for this parameter is *no* filtering.

The `searchcriterion` parameter is a string that specifies the criterion to be used by the `selection` parameter. Possible values depend on the function being used, but are often times "code" for filtering based on code or "content" for filtering based on the content description. The default for this parameter is *no* filter criterion. Often times, the `searchcriterion` parameter and the `sortcriterion` parameter have the same possible values.
The `searchcriterion` parameter is a string that specifies the criterion to be used by the `selection` parameter. Possible values depend on the function being used, but are oftentimes "code" for filtering based on code or "content" for filtering based on the content description. The default for this parameter is *no* filter criterion. Oftentimes, the `searchcriterion` parameter and the `sortcriterion` parameter have the same possible values.

Examples:
```{r eval=FALSE}
Expand All @@ -39,25 +39,16 @@ gen_val2var("WAM8", selection = "WA29*", database = "genesis")
```

### Parameter: Sortcriterion
The `sortcriterion` parameter is a string that specifies whether the raw output of the API call is sorted according to the specified input. Possible values depend on the function being used, but often times "code" for sorting based on code and "content" for sorting based on the content description are possible. The default is *no* sorting.
The `sortcriterion` parameter is a string that specifies whether the raw output of the API call is sorted according to the specified input. Possible values depend on the function being used, but oftentimes "code" for sorting based on code and "content" for sorting based on the content description are possible. The default is *no* sorting.

Examples:
```{r eval=FALSE}
# Get the values of the variable "WAM8" sorted based on their codes
gen_val2var("WAM8", sortcriterion = "code")
```

### Parameter: Pagelength
The `pagelength` parameter is a number between 1 and 2500. It indicates the maximum length of the API call output. Default is 100.

Examples:
```{r eval=FALSE}
# Get the values of the variable "WAM8", where the maximum length of the output is 2500 entries
gen_val2var("WAM8", pagelength = 2500)
```

### Parameter: Language
The `language` parameter is a string. It indicates if the API call output is in German by using "de" or in English by using "en". Default is "en" (API default is "de" but it is overwritten by {restatis} to being "en").
The `language` parameter is a string. It indicates if the API call output is in German by using "de" or in English by using "en". Default is "en" (API default is "de" but it is overwritten by {restatis} to being "en"). *This is not a classical additional parameter as it is explicitly implemented in many functions.*

Examples:
```{r eval=FALSE}
Expand All @@ -68,7 +59,6 @@ gen_val2var("WAM8", language = "de")
gen_val2var("WAM8", language = "en")
```


## Explicit Overview of Additional Parameters per Function

<details>
Expand All @@ -77,7 +67,6 @@ gen_val2var("WAM8", language = "en")
| Parameter | Description |
| ----------- | ----------- |
| selection | 1-15 characters; filtering based on "code" of the objects; "*" notations are possible |
| pagelength | 1-2500 |
| language | "de" / "en" |

</details>
Expand All @@ -89,7 +78,6 @@ For cubes: (only GENESIS and regionalstatistik.de)
| Parameter | Description |
| ----------- | ----------- |
| selection | 1-10 characters; filtering based on "code" of the objects; "*" notations are possible |
| pagelength | 1-2500 |
| language | "de" / "en" |
| area | "all" / "public" / "user" |

Expand All @@ -100,7 +88,6 @@ For statistics:
| selection | 1-15 characters; filtering based on searchcriterion; "*" notations are possible |
| searchcriterion | "code" / "content" |
| sortcriterion | "code" / "content" |
| pagelength | 1-2500 |
| language | "de" / "en" |

For tables:
Expand All @@ -110,7 +97,6 @@ For tables:
| selection | 1-15 characters; filtering based on searchcriterion; "*" notations are possible |
| searchcriterion | "code" / "content" (only Zensus 2022 database) |
| sortcriterion | "code" / "top" |
| pagelength | 1-2500 |
| language | "de" / "en" |
| area | "all" / "public" / "user" |

Expand All @@ -119,7 +105,7 @@ For tables:
<details>
<summary>gen_cube</summary>

see the following official documentation: https://www-genesis.destatis.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf
see the following official documentation: https://www-genesis.destatis.de/datenbank/online/docs/GENESIS-Webservices_Einfuehrung.pdf
see the following official documentation: https://www.regionalstatistik.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf
Only available for GENESIS and regionalstatistik.de

Expand All @@ -129,7 +115,6 @@ Only available for GENESIS and regionalstatistik.de
<summary>gen_find</summary>
| Parameter | Description |
| ----------- | ----------- |
| pagelength | 1-2500 |
| language | "de" / "en" |

</details>
Expand All @@ -141,11 +126,10 @@ Only available for GENESIS and regionalstatistik.de
| selection | 1-50 characters; filtering based on "code" of the objects or searchcriterion; "*" notations are possible |
| searchcriterion | "type" / "code" / "time" / "status" |
| sortcriterion | "type" / "code" / "time" / "status" |
| pagelength | 1-2500 |
| language | "de" / "en" |
| type | - |

- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/datenbank/online/docs/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for regionalstatistik.de: https://www.regionalstatistik.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf

</details>
Expand All @@ -165,7 +149,6 @@ Only available for GENESIS and regionalstatistik.de
| Parameter | Description |
| ----------- | ----------- |
| selection | 1-15 characters; filtering based on "code" of the objects; "*" notations are possible |
| pagelength | 1-2500 |
| language | "de" / "en" |
</details>

Expand All @@ -177,7 +160,6 @@ For cubes: (only GENESIS and regionalstatistik.de)
| ----------- | ----------- |
| selection | 1-10 characters; filtering based on "code" of the objects; "*" notations are possible |
| area | "all" / "public" / "user" |
| pagelength | 1-2500 |
| language | "de" / "en" |

For variables:
Expand All @@ -187,12 +169,11 @@ For variables:
| selection | 1-6 characters; filtering based on searchcriterion; "*" notations are possible |
| searchcriterion | "code" / "content" |
| sortcriterion | "code" / "content" |
| pagelength | 1-2500 |
| language | "de" / "en" |
| area | "all" / "public" / "user" |
| type | - |

- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/datenbank/online/docs/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for the Zensus 2022 database: https://ergebnisse.zensus2022.de/datenbank/online/docs/ZENSUS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for regionalstatistik.de: https://www.regionalstatistik.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf

Expand All @@ -201,7 +182,6 @@ For tables:
| Parameter | Description |
| ----------- | ----------- |
| selection | 1-15 characters; filtering based on "code" of the objects; "*" notations are possible |
| pagelength | 1-2500 |
| language | "de" / "en" |
| area | "all" / "public" / "user" |
</details>
Expand All @@ -213,7 +193,6 @@ For cubes: (only GENESIS and regionalstatistik.de)
| Parameter | Description |
| ----------- | ----------- |
| selection | 1-15 characters; filtering based on "code" of the objects; "*" notations are possible |
| pagelength | 1-2500 |
| language | "de" / "en" |
| area | "all" / "public" / "user" |

Expand All @@ -224,7 +203,6 @@ For statistics:
| selection | 1-15 characters; filtering based on searchcriterion; "*" notations are possible |
| searchcriterion | "code" / "content" |
| sortcriterion | "code" / "content" |
| pagelength | 1-2500 |
| language | "de" / "en" |
| area | "all" / "public" / "user" |

Expand All @@ -233,15 +211,14 @@ For tables:
| Parameter | Description |
| ----------- | ----------- |
| selection | 1-15 characters; filtering based on "code" of the objects; "*" notations are possible |
| pagelength | 1-2500 |
| language | "de" / "en" |
| area | "all" / "public" / "user" |
</details>

<details>
<summary>gen_table</summary>

- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/datenbank/online/docs/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for the Zensus 2022 database: https://ergebnisse.zensus2022.de/datenbank/online/docs/ZENSUS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for regionalstatistik.de: https://www.regionalstatistik.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf

Expand All @@ -254,12 +231,11 @@ For tables:
| selection | 1-6 characters; filtering based on searchcriterion; "*" notations are possible |
| searchcriterion | "code" / "content" |
| sortcriterion | "code" / "content" |
| pagelength | 1-2500 |
| language | "de" / "en" |
| area | "all" / "public" / "user" |
| type | - |

- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/datenbank/online/docs/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for the Zensus 2022 database: https://ergebnisse.zensus2022.de/datenbank/online/docs/ZENSUS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for regionalstatistik.de: https://www.regionalstatistik.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf

Expand All @@ -272,7 +248,6 @@ For tables:
| selection | 1-15 characters; filtering based on searchcriterion; "*" notations are possible |
| searchcriterion | "code" / "content" |
| sortcriterion | "code" / "content" |
| pagelength | 1-2500 |
| language | "de" / "en" |

</details>
Expand All @@ -284,12 +259,11 @@ For tables:
| selection | 1-6 characters; filtering based on searchcriterion; "*" notations are possible |
| searchcriterion | "code" / "content" |
| sortcriterion | "code" / "content" |
| pagelength | 1-2500 |
| language | "de" / "en" |
| area | "all" / "public" / "user" |
| type | - |

- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/datenbank/online/docs/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for the Zensus 2022 database: https://ergebnisse.zensus2022.de/datenbank/online/docs/ZENSUS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for regionalstatistik.de: https://www.regionalstatistik.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf

Expand All @@ -302,12 +276,11 @@ For tables:
| selection | 1-6 characters; filtering based on searchcriterion; "*" notations are possible |
| searchcriterion | "code" / "content" |
| sortcriterion | "code" / "content" |
| pagelength | 1-2500 |
| language | "de" / "en" |
| area | "all" / "public" / "user" |
| type | - |

- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for GENESIS: https://www-genesis.destatis.de/datenbank/online/docs/GENESIS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for the Zensus 2022 database: https://ergebnisse.zensus2022.de/datenbank/online/docs/ZENSUS-Webservices_Einfuehrung.pdf
- See more in the following official documentation for regionalstatistik.de: https://www.regionalstatistik.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf

Expand All @@ -329,7 +302,6 @@ For tables:
| ----------- | ----------- |
| selection | 1-15 characters; filtering based on "code"; "*" notations are possible |
| area | "all" / "public" / "user" |
| pagelength | 1-2500 |
| language | "de" / "en" |

</details>

0 comments on commit f141a65

Please sign in to comment.