From bf30511678418c69e141ff6a1e53398bfa7f074d Mon Sep 17 00:00:00 2001 From: JosuaKugler Date: Sat, 7 Aug 2021 00:37:23 +0200 Subject: [PATCH] add documentation to read_from_csv and write_to_csv --- R/parse.R | 14 ++++++++++++++ man/read_from_csv.Rd | 16 ++++++++++++++++ man/write_to_csv.Rd | 20 ++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 man/read_from_csv.Rd create mode 100644 man/write_to_csv.Rd diff --git a/R/parse.R b/R/parse.R index 7a80b76..92fd215 100644 --- a/R/parse.R +++ b/R/parse.R @@ -205,6 +205,14 @@ 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 +#' +#' @param tables tibble list +#' @param path char +#' @param create bool +#' +#' if create is set to TRUE, the directory given in path is created +#' #' @export write_to_csv <- function(tables, path="csv/", create=F) { check_directory(path, create) @@ -215,6 +223,12 @@ write_to_csv <- function(tables, path="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 +#' #' @export read_from_csv <- function(path="csv/") { list(speaker = read.table(str_c(path, "speaker.csv")) %>% diff --git a/man/read_from_csv.Rd b/man/read_from_csv.Rd new file mode 100644 index 0000000..4bf7e55 --- /dev/null +++ b/man/read_from_csv.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/parse.R +\name{read_from_csv} +\alias{read_from_csv} +\title{Read the needed tables for developing from a csv file.} +\usage{ +read_from_csv(path = "csv/") +} +\arguments{ +\item{path}{char + +Reading the tables from a csv is way faster than reading and repairing the data every single time} +} +\description{ +Read the needed tables for developing from a csv file. +} diff --git a/man/write_to_csv.Rd b/man/write_to_csv.Rd new file mode 100644 index 0000000..649bb29 --- /dev/null +++ b/man/write_to_csv.Rd @@ -0,0 +1,20 @@ +% 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 the parsed and repaired results into a csv file to make loading and developing faster and easier} +\usage{ +write_to_csv(tables, path = "csv/", create = F) +} +\arguments{ +\item{tables}{tibble list} + +\item{path}{char} + +\item{create}{bool + +if create is set to TRUE, the directory given in path is created} +} +\description{ +Write the parsed and repaired results into a csv file to make loading and developing faster and easier +}