瀏覽代碼

add Documentation for write_to_csv

genderequality-alternative
Leon Burgard 4 年之前
父節點
當前提交
c22bc0b91b
共有 4 個檔案被更改,包括 57 行新增2 行删除
  1. +8
    -0
      R/parse.R
  2. +24
    -0
      man/lookup_speaker.Rd
  3. +7
    -2
      man/repair.Rd
  4. +18
    -0
      man/write_to_csv.Rd

+ 8
- 0
R/parse.R 查看文件

@@ -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
- 0
man/lookup_speaker.Rd 查看文件

@@ -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
man/repair.Rd 查看文件

@@ -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
- 0
man/write_to_csv.Rd 查看文件

@@ -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.
}

Loading…
取消
儲存