add documentation to read_from_csv and write_to_csv
This commit is contained in:
@@ -205,6 +205,14 @@ parse_speakerlist <- function(speakerliste_xml) {
|
|||||||
rolle_lang = d["rolle_lang",])
|
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
|
#' @export
|
||||||
write_to_csv <- function(tables, path="csv/", create=F) {
|
write_to_csv <- function(tables, path="csv/", create=F) {
|
||||||
check_directory(path, create)
|
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"))
|
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
|
#' @export
|
||||||
read_from_csv <- function(path="csv/") {
|
read_from_csv <- function(path="csv/") {
|
||||||
list(speaker = read.table(str_c(path, "speaker.csv")) %>%
|
list(speaker = read.table(str_c(path, "speaker.csv")) %>%
|
||||||
|
|||||||
@@ -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.
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user