#' @title Economic Calendar
#' @description Get economic calendar
#'
#' @importFrom tibble as_tibble
#' @importFrom purrr set_names
#' @importFrom dplyr mutate select
#' @importFrom lubridate ymd_hms
#'
#' @return
#' @export
#'
#' @examples
#' economic_calendar()
economic_calendar <- function(...){
url <- finnhub_endpoint('economic_calendar')
df <- retry_get(url,
query = list(token = finnhub_key()))
df %>%
.[['economicCalendar']] %>%
purrr::set_names(c('actual', 'country', 'estimate', 'event', 'impact',
'previous', 'time', 'unit')) %>%
dplyr::mutate(date = lubridate::ymd_hms(time, tz = finnhub_timezone)) %>%
dplyr::select(date, event, impact, previous, estimate, actual,
unit, country, time)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.