#' @title Earnings per Share Surprises
#' @description Get EPS surprises
#'
#' @param symbol Stock ticker
#'
#' @importFrom purrr set_names
#' @importFrom dplyr mutate select everything
#' @importFrom lubridate ymd
#'
#' @return
#' @export
#'
#' @examples
#' eps_surprises('NVDA')
eps_surprises <- function(symbol, ...){
url <- finnhub_endpoint('eps_surprises')
df <- retry_get(url,
query = list(token = finnhub_key(),
symbol = symbol))
df %>%
dplyr::mutate(date = lubridate::ymd(period, tz = finnhub_timezone)) %>%
dplyr::select(symbol, date, dplyr::everything()) %>%
purrr::set_names(c('symbol', 'date', 'actual_eps', 'estimated_eps', 'period'))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.