R/oldest_player.R

Defines functions oldest_player

Documented in oldest_player

#'oldest_player function
#'
#' This function shows the oldest player in the year selected
#' @param year The year of the data
#' @keywords oldest_player
#' @export
#' @examples
#' oldest_player(year)

oldest_player <- function(year){
  age_data <-  dplyr::filter(data, Year == year)
  newdata <- dplyr::arrange(age_data, desc(Age))
  newdata$Player[1]
}
tony-924/HW5 documentation built on March 5, 2020, 12:49 a.m.