-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (70 loc) · 4.1 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
title: "Schülerinnen und Schüler der öffentlichen Volksschule nach Schulgemeinden im Kanton Thurgau"
author: "OGD-Koordinationsstelle Kanton Thurgau"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Open Government Data, provided by **Canton Thurgau**
*Autogenerated R starter code for dataset with the identifier* **dek-gs-1**
# **Schülerinnen und Schüler der öffentlichen Volksschule nach Schulgemeinden im Kanton Thurgau**
[Link to dataset on data.tg.ch](https://data.tg.ch/explore/dataset/dek-gs-1/information/)
## Description
<p>Die Übersicht zeigt alle Schülerinnen und Schüler der öffentlichen Volksschule des Kantons Thurgau ab dem Schuljahr 2007/2008 bis und mit 2021 nach Schulgemeinde, Geschlecht und Staatsangehörigkeit (Schweiz vs. Ausland). Mit Volksschule wird die Schulbildung während der obligatorischen Schulzeit bezeichnet. Die obligatorische Schulzeit umfasst den Kindergarten, sechs Jahre Primarschule und drei Jahre Sekundarstufe I. Nicht mitgezählt sind Schülerinnen und Schüler der Mittelschulen, Schülerinnen und Schüler in Sonderklassen (besondere Klassen) und Sonderschulen, sowie Schülerinnen und Schüler in Privatschulen. Es gilt das Schulstandortprinzip - gezählt werden Schülerinnen und Schüler, welche eine Schule innerhalb des Kantons Thurgau besuchen.</p><p><span style='font-size: 0.875rem;'>Stichtag</span>: jeweils am 15. September</p><p><b>Hinweis: Ab dem Jahr 2021 werden die Informationen zu Schülerinnen und Schülern der öffentlichen Volksschule in drei Datensätzen publiziert:</b> </p><ul><li>Schülerinnen und Schüler der öffentlichen Volksschule nach Staatsangehörigkeit auf Ebene Gesamtkanton</li><li>Schülerinnen und Schüler der öffentlichen Volksschule nach Staatszugehörigkeit (Schweiz vs. Ausland) auf Ebene Schulgemeinde</li><li>Schülerinnen und Schüler der öffentlichen Volksschule nach Erstsprache auf Ebene Schulgemeinde</li></ul><p><br></p>
## Metadata
- **Issued** : 2020-11-22
- **Modified** : 2024-11-01 10:33:10
- **Rights** : CC By 4.0
- **Keywords** : Bildungsstatistik , Geschlecht , Nationalität, Schüler, Schülerin, Lernende , Volksschule , Sekundarstufe , Primarschule, Kindergarten, Schulgemeinde
## Load Packages
Every dataset (csv and geodata) on [data.tg.ch](https://data.tg.ch/pages/start/) can be retrieved with the **tgAPI** package. You can download it via [GitHub](https://github.com/ogdtg/tgAPI). Please note that the package has some dependencies, which can result in a lengthy installation process. Therefore, we do not recommend installing the package directly in Google Colab. However, if you intend to run this code on your local machine, we strongly recommend installing the tgAPI package.
```{r}
library(httr)
library(jsonlite)
library(dplyr)
# library(remotes)
# remotes::install.github("ogdtg/tgAPI")
```
## Download Data
```{r}
# Download the Dataset via API
res <- httr::GET("https://data.tg.ch/api/explore/v2.0/catalog/datasets/dek-gs-1/exports/json")
data <- res$content %>%
rawToChar() %>%
jsonlite::fromJSON()
# Use tgAPI
# data <- tgAPI::get_dataset("dek-gs-1")
head(data)
```
## Explore Metadata
```{r}
res <- httr::GET("https://data.tg.ch/api/explore/v2.0/catalog/datasets/dek-gs-1")
metadata <- res$content %>%
rawToChar() %>%
jsonlite::fromJSON()
# Fields name
cat("\nFields name")
metadata$dataset$fields$name
# Fields description
cat("\nFields description")
metadata$dataset$fields$description
# Fields data type
cat("\nFields data type")
metadata$dataset$fields$type
```
## Analyze data
```{r}
# Look at the dataset and its structure
summary(data)
```
## Continue your code here...
```{r}
# Do some data magic with R
```
------------------------------------------------------------------------
## Questions about the data?
Contact us via [Mail](mailto:[email protected]) or visit our [GitHub presence](https://github.com/ogdtg)
------------------------------------------------------------------------
OGD-Koordinationsstelle Kanton Thurgau | Grabenstrasse 8 | 8510 Frauenfeld