|
|
|
@@ -8,7 +8,7 @@ |
|
|
|
#' @param path character |
|
|
|
#' |
|
|
|
#' @export |
|
|
|
read_all <- function(path="records/") { |
|
|
|
read_all <- function(path="data/records/") { |
|
|
|
cat("Reading all records from", path, "\n") |
|
|
|
available_protocols <- list.files(path) |
|
|
|
res <- pblapply(available_protocols, read_one, path=path) |
|
|
|
@@ -214,7 +214,7 @@ parse_speakerlist <- function(speakerliste_xml) { |
|
|
|
#' if create is set to TRUE, the directory given in path is created |
|
|
|
#' |
|
|
|
#' @export |
|
|
|
write_to_csv <- function(tables, path="csv/", create=F) { |
|
|
|
write_to_csv <- function(tables, path="data/csv/", create=F) { |
|
|
|
check_directory(path, create) |
|
|
|
write.table(tables$speaker, str_c(path, "speaker.csv")) |
|
|
|
write.table(tables$speeches, str_c(path, "speeches.csv")) |
|
|
|
@@ -230,7 +230,7 @@ write_to_csv <- function(tables, path="csv/", create=F) { |
|
|
|
#' Reading the tables from a csv is way faster than reading and repairing the data every single time |
|
|
|
#' |
|
|
|
#' @export |
|
|
|
read_from_csv <- function(path="csv/") { |
|
|
|
read_from_csv <- function(path="data/csv/") { |
|
|
|
list(speaker = read.table(str_c(path, "speaker.csv")) %>% |
|
|
|
tibble() %>% |
|
|
|
mutate(id = as.character(id)), |
|
|
|
|