R/company_executive.R

Defines functions company_executive

Documented in company_executive

#' @title Company executives
#' @description Get a list of company executives, age, sex, length of employment 
#' and compensation
#' 
#' @param symbol Stock ticker
#' 
#' @importFrom dplyr mutate
#' @importFrom purrr set_names

#' @return
#' @export
#' 
#' @examples
#' company_executive('NVDA')
company_executive <- function(symbol, ...){
  
  url <- finnhub_endpoint('company_executive')
  
  retry_get(url, 
            query = list(token = finnhub_key(),
                         symbol = symbol)) %>%
    .[['executive']] %>%  
    purrr::set_names(c('age', 'compensation' ,'currency', 'name', 'position',
                       'sex', 'since')) %>% 
    
    dplyr::mutate(symbol = symbol)
}
threadingdata/finnhubr documentation built on Aug. 10, 2020, 12:48 a.m.