Skip to content

Commit

Permalink
Changes to allow for multiple Rmd files
Browse files Browse the repository at this point in the history
Line 5: Edited description parameter rmd_file to more clearly state to enter multiple Rmd files as a list.
Line 38: Added [i] to forloop over rmd_file so it allows for multiple Rmd files in the parameter rmd_file.
  • Loading branch information
ilsePit authored Dec 30, 2020
1 parent c4ad052 commit 864c1f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/tidy_bib_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Removes duplicate and unneeded entries from a Bib(La)Tex-file.
#'
#' @param rmd_file Character. One or more paths to the R Markdown files that use the messy bibliography file.
#' @param rmd_file Character. One path or a list of paths to the R Markdown files that use the messy bibliography file.
#' @param messy_bibliography Character. Path to the messy bibliography file.
#' @param file Character. Path and name for the to-be-created tidy bibliography. If \code{NULL} the messy bibliography is replaced.
#' @inheritParams query_bib
Expand Down Expand Up @@ -35,7 +35,7 @@ tidy_bib_file <- function(

rmd <- c()
for(i in seq_along(rmd_file)) {
rmd <- paste(c(rmd, readLines(rmd_file, encoding = encoding, warn = FALSE)), collapse = " ")
rmd <- paste(c(rmd, readLines(rmd_file[i], encoding = encoding, warn = FALSE)), collapse = " ")
}

if(nchar(rmd) == 0){
Expand Down

0 comments on commit 864c1f0

Please sign in to comment.