Skip to content

get_tasas_diarias #31

@Johan-rosa

Description

@Johan-rosa

Draft by @juansqw

#' Download daily interest rate
#'
#' Get the series of daily interest rate of the Dominican Republic.
#'
#' @return a data frame with monthly series
#' @export
#'
#' @examples
#' get_fbkf()
get_tasas_diarias <- function(year) {
  file_url <- paste0("https://cdn.bancentral.gov.do/documents/",
                     "estadisticas/sector-monetario-y-financiero/",
                     glue::glue("documents/tasas_diariasBM-{year}.xlsx"))
  file_path <- tempfile(pattern = "", fileext = "")
  utils::download.file(file_url, file_path, mode = "wb", quiet = TRUE)

  suppressMessages(
    data <- readxl::read_excel(
      path = file_path,
      skip = 11,
      trim_ws = TRUE,
      col_names = FALSE
    )
  )

  data2 <- data |>
    apply()


    dplyr::mutate(month = readr::parse_vector(`...1`, readr::col_character()))


}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions