#' @title Company Margin Metrics
#' @description Company margin metrics
#'
#' @param symbol Ticker symbol
#'
#' @importFrom tibble tibble
#' @importFrom dplyr bind_cols mutate select everything
#' @importFrom lubridate now
#'
#' @return
#' @export
#'
#' @examples
#' margin_metrics('NVDA')
margin_metrics <- function(symbol, ...){
url <- finnhub_endpoint('margin_metrics')
df <- retry_get(url,
query = list(token = finnhub_key(),
symbol = symbol,
metric = 'margin'))
df %>%
.[['metric']] %>%
dplyr::bind_cols() %>%
dplyr::mutate(symbol = symbol,
query_date = lubridate::now(tz = finnhub_timezone)) %>%
dplyr::select(symbol, dplyr::everything())
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.