R/economic_code.R

Defines functions economic_code

Documented in economic_code

#' @title Economic Codes
#' @description Get economic codes
#'  
#' @importFrom dplyr select
#' @importFrom tibble as_tibble
#' 
#' @return
#' @export
#' 
#' @examples
#' economic_code()
#' economic_code() %>% 
#' dplyr::filter(stringr::str_detect(name, 'Unemployment'), country == 'United States')
economic_code <- function(...){
  
  url <- finnhub_endpoint('economic_code')
  
  df <- retry_get(url,
                  query = list(token = finnhub_key()))
  
  df %>% 
    dplyr::select(country, name, code, unit) %>% 
    tibble::as_tibble()
}
threadingdata/finnhubr documentation built on Aug. 10, 2020, 12:48 a.m.