refactor project structure

This commit is contained in:
2021-08-07 01:16:56 +02:00
parent bf30511678
commit 53fdb7530b
23 changed files with 22 additions and 19 deletions
+3 -3
View File
@@ -26,18 +26,18 @@ library(tidyr)
First, you need to download all records of the current legislative period.
```r
fetch_all("../records/") # path to directory where records should be stored
fetch_all("../data/records/") # path to directory where records should be stored
```
Second, those `.xml` files, need to be parsed into `R` `tibbles`. This is accomplished by:
```r
read_all("../records/") %>% repair() -> res
read_all("../data/records/") %>% repair() -> res
```
We also used `repair` to fix a bunch of formatting issues in the records and unpacked
the result into more descriptive variables.
For development purposes, we load the tables from csv files.
```{r}
res <- read_from_csv('../csv/')
res <- read_from_csv('../data/csv/')
```
and unpack our tibbles
```{r}
+4 -4
View File
@@ -25,11 +25,11 @@ library(ggplot2)
First, you need to download all records of the current legislative period.
```r
fetch_all("../records/") # path to directory where records should be stored
fetch_all("../data/records/") # path to directory where records should be stored
```
Second, those `.xml` files, need to be parsed into `R` `tibbles`. This is accomplished by:
```r
read_all("../records/") %>% repair() -> res
read_all("../data/records/") %>% repair() -> res
speeches <- res$speeches
speaker <- res$speaker
@@ -40,7 +40,7 @@ the result into more descriptive variables.
For development purposes, we load the tables from csv files.
```{r}
tables <- read_from_csv('../csv/')
tables <- read_from_csv('../data/csv/')
comments <- tables$comments
speeches <- tables$speeches
@@ -50,7 +50,7 @@ talks <- tables$talks
Further, we need to load a list of words that were used by Hitler but not by standard German texts.
```{r}
fil <- file('../hitler_texts/hitler_words')
fil <- file('../data/hitler_texts/hitler_words')
Worte <- readLines(fil)
hitlerwords <- tibble(Worte)
```