R/oldest_player.R

Defines functions oldest_player

Documented in oldest_player

#' A Age Function
#'
#' This function allows you to find the oldest player in a given year of the dataset.
#' @param year
#' @keywords age
#' @export
#' @examples
#' oldest_player(1995)

oldest_player <- function(year) {
  nbayear <- dplyr::filter(nba, Year == year)
  as.character(nbayear$Player[which.max(nbayear$Age)])
}
VickyRen2018/nbafunctions documentation built on May 25, 2019, 2:22 p.m.