Bladeren bron

add documentation to read_from_csv and write_to_csv

genderequality-alternative
JosuaKugler 4 jaren geleden
bovenliggende
commit
bf30511678
3 gewijzigde bestanden met toevoegingen van 50 en 0 verwijderingen
  1. +14
    -0
      R/parse.R
  2. +16
    -0
      man/read_from_csv.Rd
  3. +20
    -0
      man/write_to_csv.Rd

+ 14
- 0
R/parse.R Bestand weergeven

@@ -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")) %>%


+ 16
- 0
man/read_from_csv.Rd Bestand weergeven

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

+ 20
- 0
man/write_to_csv.Rd Bestand weergeven

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

Laden…
Annuleren
Opslaan