Skip to content

Commit 5e25537

Browse files
committed
fix: improve variable descriptions
1 parent 455e6a5 commit 5e25537

File tree

1 file changed

+28
-20
lines changed

1 file changed

+28
-20
lines changed

docs/codebook.qmd

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ Since 2004, MPs from the Faroe Islands were members of `r sum(political_parties$
166166
#| label: tbl-parties
167167
#| tbl-cap: List of political parties from Greenland and the Faroe Islands with a MP in Folketinget since 2004.
168168
169-
parties_gl <- subset(political_parties, Origin == "GL")[, !(names(political_parties) %in% "Origin")]
170-
parties_fo <- subset(political_parties, Origin == "FO")[, !(names(political_parties) %in% "Origin")]
169+
parties_gl <- subset(political_parties, Origin == "GL")[, !(names(political_parties) %in% c("Origin", "Colour"))]
170+
parties_fo <- subset(political_parties, Origin == "FO")[, !(names(political_parties) %in% c("Origin", "Colour"))]
171171
172172
rownames(parties_gl) <- NULL
173173
rownames(parties_fo) <- NULL
@@ -297,6 +297,14 @@ Take care not to confuse `afstemningid` with [`ballot_results_ft$ballot_nr`](#ba
297297
head(northatlantic_votes_raw$afstemningid)
298298
```
299299

300+
#### northatlantic_votes_raw\$aktørid
301+
302+
See [`northatlantic_votes$MP_id`](#northatlantic_votesmp_id). In the raw data, `aktørid` is stored as `r typeof(northatlantic_votes_raw$aktørid)` value.
303+
304+
```{r}
305+
head(northatlantic_votes_raw$aktørid)
306+
```
307+
300308
#### northatlantic_votes_raw\$opdateringsdato
301309

302310
For all records kept in [the Folketing online database](https://oda.ft.dk), the time stamp of its last update is stored in `opdateringsdato`. All dates are stored as values of the type `r typeof(northatlantic_votes_raw$opdateringsdato)`. The time stamps are formatted as `%Y-%m-%dT%T`, with some values even at split second level.
@@ -585,31 +593,29 @@ head(ballot_topics$ft_process_id)
585593

586594
#### ballot_topics\$ft_process_step {#ballot_topicsft_process_step}
587595

588-
All legislative processes in Folketinget run their course through Folketinget in several steps which is described by `ft_process_step`. Process Steps are stored as values of the type `r typeof(ballot_topics$ft_process_step)` in Danish language..
589-
590-
<!-- FIXME This variable corresponds to the [`sagstrinid`](#ballot_info_rawsagstrinid) variable and the `Sagstrin` resource in [the Folketing online database](https://oda.ft.dk). -->
596+
All legislative processes in Folketinget run their course through Folketinget in several steps which is described by `ft_process_step`. Process steps are stored as values of the type `r typeof(ballot_topics$ft_process_step)` in Danish language.
591597

592-
`ft_process_id` is used to join `ballot_topics` to [`northatlantic_ft`](#northatlantic_ft) based on matching with[`ballot_results_ft$ft_process_id`](#ballot_results_ftft_process_id).
598+
This variable corresponds to the `titel` variable in the `Sagstrin` resource in [the Folketing online database](https://oda.ft.dk).
593599

594600
```{r}
595-
summary(ballot_topics$ft_process_step)
601+
head(ballot_topics$ft_process_step)
596602
```
597603

598604
#### ballot_topics\$ft_topic_id {#ballot_topicsft_topic_id}
599605

600-
::: callout-note
601-
Description of new variable missing
602-
:::
606+
Each proposal that is being voted on in Folketinget is assigned an ID by [Folketingets åbne data service (ODA)](https://www.ft.dk/dokumenter/aabne_data) based on the proposal's topic. Each topic ID is thus a unique identifier for one topic relating to several ballots and debates etc. in Folketinget. This identifier is stored in `ft_topic_id`. Topic IDs are stored as values of the type `r typeof(ballot_topics$ft_topic_id)` as `r class(ballot_topics$ft_topic_id)` variable.
607+
608+
This variable corresponds to the `id` variable in the `Sag` resource in [the Folketing online database](https://oda.ft.dk).
603609

604610
```{r}
605611
head(ballot_topics$ft_topic_id)
606612
```
607613

608614
#### ballot_topics\$ft_topic {#ballot_topicsft_topic}
609615

610-
::: callout-note
611-
Description of new variable missing
612-
:::
616+
Each proposal that is being voted on in Folketinget has a description of the topic(s) that are mentioned in the proposal. This description is stored in `ft_topic`. Topic descriptions are stored as values of the type `r typeof(ballot_topics$ft_topic)` as `r class(ballot_topics$ft_topic)` variable.
617+
618+
This variable corresponds to the `titel` variable in the `Sag` resource in [the Folketing online database](https://oda.ft.dk).
613619

614620
```{r}
615621
head(ballot_topics$ft_topic)
@@ -619,7 +625,7 @@ head(ballot_topics$ft_topic)
619625

620626
### northatlantic_ft {#northatlantic_ft}
621627

622-
`northatlantic_ft` is the resulting product of the [targets pipeline](/_targets.R) and is provided as both `rds` file in `/data/processed` and `csv` file in `/data/processed/csv`. It contains data on voting records of the MPs specified in [`MP_names`](#mp_names), created by processing and joining [`ballot_results_ft`](#ballot_results_ft) and [`northatlantic_votes`](#northatlantic_votes). As per `r format(file.info(here("data", "processed", "northatlantic_ft.rds"))$mtime, "%B %Y")`, `northatlantic_ft` contains `r nrow(northatlantic_ft)` observations of `r ncol(northatlantic_ft)` variables.
628+
`northatlantic_ft` is the resulting product of the [targets pipeline](/_targets.R) and is provided as both `rds` file in `/data/processed` and `csv` file in `/data/processed/csv`. It contains data on voting records of the MPs specified in [`MP_names`](#mp_names), created by processing and joining [`ballot_results_ft`](#ballot_results_ft), [`northatlantic_votes`](#northatlantic_votes) and [`ballot_topics`](#ballot_topics). As per `r format(file.info(here("data", "processed", "northatlantic_ft.rds"))$mtime, "%B %Y")`, `northatlantic_ft` contains `r nrow(northatlantic_ft)` observations of `r ncol(northatlantic_ft)` variables.
623629

624630
```{r}
625631
str(northatlantic_ft)
@@ -669,9 +675,11 @@ str(northatlantic_ft$vote_type_id)
669675

670676
#### northatlantic_ft\$vote_id
671677

672-
::: callout-warning
673-
Description of new variable missing
674-
:::
678+
See [`northatlantic_votes$votes_id`](#northatlantic_votesvote_id).
679+
680+
```{r}
681+
str(northatlantic_ft$vote_id)
682+
```
675683

676684
#### northatlantic_ft\$ballot_pass
677685

@@ -683,23 +691,23 @@ str(northatlantic_ft$ballot_pass)
683691

684692
#### northatlantic_ft\$ft_process_step
685693

686-
`ft_process_step` is created by using [`join_results()`](/src/targets/join_results.R) on `northatlantic_votes`, `ballot_results_ft`, `MP_names` and `ballot_topics`. See [`ballot_topics$ft_process_step`](#ballot_topicsft_process_step).
694+
See [`ballot_topics$ft_process_step`](#ballot_topicsft_process_step).
687695

688696
```{r}
689697
str(northatlantic_ft$ft_process_step)
690698
```
691699

692700
#### northatlantic_ft\$ft_topic_id
693701

694-
`ft_topic_id` is created by using [`join_results()`](/src/targets/join_results.R) on `northatlantic_votes`, `ballot_results_ft`, `MP_names` and `ballot_topics`. See [`ballot_topics$ft_topic_id`](#ballot_topicsft_topic_id).
702+
See [`ballot_topics$ft_topic_id`](#ballot_topicsft_topic_id).
695703

696704
```{r}
697705
str(northatlantic_ft$ft_topic_id)
698706
```
699707

700708
#### northatlantic_ft\$ft_topic
701709

702-
`ft_topic` is created by using [`join_results()`](/src/targets/join_results.R) on `northatlantic_votes`, `ballot_results_ft`, `MP_names` and `ballot_topics`. See [`ballot_topics$ft_topic`](#ballot_topicsft_topic).
710+
See [`ballot_topics$ft_topic`](#ballot_topicsft_topic).
703711

704712
```{r}
705713
str(northatlantic_ft$ft_topic)

0 commit comments

Comments
 (0)