R/NBA_compare.R

Defines functions com_team

Documented in com_team

  #' Compare the salary for two groups
  #' @param df1 a NBA team
  #' @param df2 another NBA team
  #' @return a line graph
  #' @examples com_team(Spurs, Rockets), com_team(Rockets, Mavericks),com_team(Spurs, Mavericks)
  #' @export

  com_team<- function(df1,df2){
    library(tidyverse)
    library(ggplot2)
    ggplot(rbind(df1,df2), aes(x=Season, y=Total_Salary, color = Team))  + geom_line(aes(group=Team)) + geom_point(shape = 19)
  }
MingshuangLi/Mingshuang_finalproject_RProgtamming documentation built on May 24, 2019, 4:05 p.m.