From d42a039b31b2208c24ef74377841c790c9f20c52 Mon Sep 17 00:00:00 2001 From: JosuaKugler Date: Wed, 28 Jul 2021 21:07:07 +0200 Subject: [PATCH] fix vignette --- .Rbuildignore | 2 ++ .gitignore | 2 ++ NAMESPACE | 2 ++ R/parse.R | 2 ++ vignettes/funwithdata.Rmd | 2 +- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index 72278f5..7b0f72c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,4 @@ ^doc$ ^Meta$ +^.*\.Rproj$ +^\.Rproj\.user$ diff --git a/.gitignore b/.gitignore index 1c8f6d1..fa12f8f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ !/reports/*.tex /csv/* /parlament_49_53_texts/ +.Rproj.user +*.Rproj diff --git a/NAMESPACE b/NAMESPACE index 7fe3834..b52ac75 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,7 +2,9 @@ export(fetch_all) export(read_all) +export(read_from_csv) export(repair) +export(write_to_csv) import(dplyr) import(pbapply) import(purrr) diff --git a/R/parse.R b/R/parse.R index 1a5b561..d3d2476 100644 --- a/R/parse.R +++ b/R/parse.R @@ -189,6 +189,7 @@ parse_rednerliste <- function(rednerliste_xml) { rolle_lang = d["rolle_lang",]) } +#' @export write_to_csv <- function(tables, path="csv/", create=F) { check_directory(path, create) 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")) } +#' @export read_from_csv <- function(path="csv/") { list(redner = read.table(str_c(path, "redner.csv")) %>% tibble() %>% diff --git a/vignettes/funwithdata.Rmd b/vignettes/funwithdata.Rmd index b70ebc9..098ce4c 100644 --- a/vignettes/funwithdata.Rmd +++ b/vignettes/funwithdata.Rmd @@ -39,7 +39,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('../csv/') comments <- tables$comments reden <- tables$reden