add Documentation for write_to_csv

This commit is contained in:
Leon Burgard
2021-08-04 16:47:06 +02:00
parent 5f9343bf7f
commit c22bc0b91b
4 changed files with 57 additions and 2 deletions
+8
View File
@@ -205,6 +205,14 @@ parse_speakerliste <- function(speakerliste_xml) {
rolle_lang = d["rolle_lang",])
}
#' Write to CSV-Document
#'
#' Put all tables from the entered list in separate CSV documents.
#'
#' @param tables The List of Tables you want to convert into a CSV-Document.
#' @param path The path where to put the CSV-Document.
#' @param create Set TRUE if the path does not exist yet and you want to create it.
#'
#' @export
write_to_csv <- function(tables, path="csv/", create=F) {
check_directory(path, create)
+24
View File
@@ -0,0 +1,24 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/repair.R
\name{lookup_speaker}
\alias{lookup_speaker}
\title{Lookup name in speakers table}
\usage{
lookup_speaker(tb, speaker, name_variable)
}
\arguments{
\item{tb}{tibble}
\item{name_variable}{name
Tries to match the name_variable column with speaker names
returns a lookup table}
\item{redner}{tibble}
}
\description{
Tries to find the correct speaker id given a name.
This is sufficient since every prename lastname combination in the bundestag is
unique (luckily :D)
}
+7 -2
View File
@@ -4,8 +4,13 @@
\alias{repair}
\title{Repair parsed tables}
\usage{
repair(parse_output)
repair(parse_output, repair_comments = FALSE)
}
\description{
Repair parsed tables
TODO: Explain repair_comments argument
(if TRUE, we try to lookup redner names in redner table)
}
\details{
Possible test: check identical(repair(res), repair(repair(res))) == TRUE
Since repaired tables should be a fixpoint of repair.
}
+18
View File
@@ -0,0 +1,18 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/parse.R
\name{write_to_csv}
\alias{write_to_csv}
\title{Write to CSV-Document}
\usage{
write_to_csv(tables, path = "csv/", create = F)
}
\arguments{
\item{tables}{The List of Tables you want to convert into a CSV-Document.}
\item{path}{The path where to put the CSV-Document.}
\item{create}{Set TRUE if the path does not exist yet and you want to create it.}
}
\description{
Put all tables from the entered list in separate CSV documents.
}