R/NBA_one_vs_others.R

Defines functions team

Documented in team

#' Compare the salary for a group with the others.
#' @param df the team
#' @return a graph
#' @examples team(Spurs), team(Mavericks), team(Rockets)
#' @export

team <- function(df){
  library(tidyverse)
  library(ggplot2)
  ggplot(new_NBA_salary, aes(x=Season, y=Total_Salary, group = Team)) +
    geom_line(color="gray66", alpha=.25) +
    geom_line(data=df, color="firebrick", lwd=1)+
    theme(legend.position="none") +
    theme_classic() +
    ggtitle(paste0(df$Team[1]," vs Other NBA teams"))

}
MingshuangLi/Mingshuang_finalproject_RProgtamming documentation built on May 24, 2019, 4:05 p.m.