Nothing
# lookup functions for players and teams
#' @export
playerInfo <- function(playerID, nameFirst, nameLast, data=Lahman::People, extra=NULL, ...) {
wanted <- NULL
if(!missing(playerID)) wanted <- c(wanted, grep(playerID, data$playerID, ...))
if(!missing(nameFirst)) wanted <- c(wanted, grep(nameFirst, data$nameFirst, ...))
if(!missing(nameLast)) wanted <- c(wanted, grep(nameLast, data$nameLast, ...))
data[unique(wanted), c("playerID", "nameFirst", "nameLast", extra)]
}
#' @export
teamInfo <- function(teamID, name, data=Lahman::Teams, extra=NULL, ...) {
wanted <- NULL
if(!missing(teamID)) wanted <- c(wanted, grep(teamID, data$teamID, ...))
if(!missing(name)) wanted <- c(wanted, grep(name, data$name, ...))
res <- data[unique(wanted), c("teamID", "name", extra)]
res[!duplicated(res$teamID),]
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.