fix vignette

This commit is contained in:
2021-07-28 21:07:07 +02:00
parent 63441d886c
commit d42a039b31
5 changed files with 9 additions and 1 deletions
+2
View File
@@ -1,2 +1,4 @@
^doc$ ^doc$
^Meta$ ^Meta$
^.*\.Rproj$
^\.Rproj\.user$
+2
View File
@@ -6,3 +6,5 @@
!/reports/*.tex !/reports/*.tex
/csv/* /csv/*
/parlament_49_53_texts/ /parlament_49_53_texts/
.Rproj.user
*.Rproj
+2
View File
@@ -2,7 +2,9 @@
export(fetch_all) export(fetch_all)
export(read_all) export(read_all)
export(read_from_csv)
export(repair) export(repair)
export(write_to_csv)
import(dplyr) import(dplyr)
import(pbapply) import(pbapply)
import(purrr) import(purrr)
+2
View File
@@ -189,6 +189,7 @@ parse_rednerliste <- function(rednerliste_xml) {
rolle_lang = d["rolle_lang",]) rolle_lang = d["rolle_lang",])
} }
#' @export
write_to_csv <- function(tables, path="csv/", create=F) { write_to_csv <- function(tables, path="csv/", create=F) {
check_directory(path, create) check_directory(path, create)
write.table(tables$redner, str_c(path, "redner.csv")) write.table(tables$redner, str_c(path, "redner.csv"))
@@ -197,6 +198,7 @@ write_to_csv <- function(tables, path="csv/", create=F) {
write.table(tables$comments, str_c(path, "comments.csv")) write.table(tables$comments, str_c(path, "comments.csv"))
} }
#' @export
read_from_csv <- function(path="csv/") { read_from_csv <- function(path="csv/") {
list(redner = read.table(str_c(path, "redner.csv")) %>% list(redner = read.table(str_c(path, "redner.csv")) %>%
tibble() %>% tibble() %>%
+1 -1
View File
@@ -39,7 +39,7 @@ the result into more descriptive variables.
For development purposes, we load the tables from csv files. For development purposes, we load the tables from csv files.
```{r} ```{r}
tables <- read_from_csv('csv/') tables <- read_from_csv('../csv/')
comments <- tables$comments comments <- tables$comments
reden <- tables$reden reden <- tables$reden