#' oldestplayer.by.year
#'
#' This function allows you to view oldest player in Seasons_Stats_NBA dataset
#' for the year you enter as an argument
#' @param year a numerical value ranging from 1950-2017
#' @return players
#' @examples
#' oldestplayer.by.year()
#' @export
oldestplayer.by.year <- function(dt, year) {
age <- dplyr::filter(dt, Year == year)
dplyr::dt[select(Player,Age)]
with(age, Player[which.max(Age)]) #use which.max instead of max to return the first max value
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.