R/read_statements.R

#' Read and clean many Finnish Nordea bank statement pdf-files at once.
#'
#' This is just a convenient wrapper of \code{read_statement} (singular).
#'
#' @param directory A full path to the directory including the pdf-files of interest.
#'
#' @importFrom dplyr "%>%"
#' @export

read_statements <- function(directory) {

    data <- directory %>%
        stringr::str_c(dir(directory)) %>%
        stringr::str_subset(".pdf") %>%
        purrr::map_dfr(rnordeatools::read_statement) %>%
        dplyr::arrange(record_date)

    return(data)
}
eteppo/r-nordea-tools documentation built on June 14, 2019, 3:48 a.m.