This commit is contained in:
2021-08-07 01:36:06 +02:00
10 changed files with 176 additions and 85 deletions
+10 -11
View File
@@ -205,13 +205,11 @@ parse_speakerlist <- function(speakerliste_xml) {
rolle_lang = d["rolle_lang",])
}
#' Write the parsed and repaired results into a csv file to make loading and developing faster and easier
#' Write the parsed and repaired results into separate csv files
#'
#' @param tables tibble list
#' @param path char
#' @param create bool
#'
#' if create is set to TRUE, the directory given in path is created
#' @param tables list of tables to convert into a csv files.
#' @param path where to put the csv files.
#' @param create set TRUE if the path does not exist yet and you want to create it
#'
#' @export
write_to_csv <- function(tables, path="data/csv/", create=F) {
@@ -223,11 +221,12 @@ write_to_csv <- function(tables, path="data/csv/", create=F) {
write.table(tables$applause, str_c(path, "applause.csv"))
}
#' Read the needed tables for developing from a csv file.
#'
#' @param path char
#'
#' Reading the tables from a csv is way faster than reading and repairing the data every single time
#' create a tibble from the csv file
#'
#' @param path directory to read files from
#'
#' reading the tables from a csv is way faster than reading and repairing the data every single time
#'
#' @export
read_from_csv <- function(path="data/csv/") {