knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

This document describes the plotting functions that this package has.

Plot to compare individual batters - oneseason_batter_compare function

This function draws a plot through comparing batters.. The return value of this function divides the player's statistics into two plots. The first plot compares stats, such as 'homeruns', 'hits', and 'scoring'. The second plot compares statss, such as batting average, slugging percentage, and on-base percentage. there is an case of error regarding the player name. For example, an error occurs when you try to compare a player that is not in the data. Also, if the player you are comparing has the same name with other players, An error will occur. To solve the problem, you can insert the id of the player who has the same name with other players

Plot to compare individual pitchers - oneseason_pitcher_compare function

This function draws a plot through comparing pitchers. The return value of this function divides the player's statistics into three plots. The first plot compares stats, such as save, earned run and hit allowed The second plot compares stats, such as Pitch number and total batter faced The third is a plot that compares the percentage stats, such as winning rate, ERA, and so on. The reason for dividing the stats into three is the scale of the values. This function also has the same error as the above function.

Plot to compare team batters stats - compare_batter_statistic_teams

This function draws a plot through comparing the batter stats of team. This function returns each plots using the ggplot facet_wrap() function for the team's hit statistics. The batter stats of two teams are compared against each other and displayed as a bar graph. The x-axis of plots represents the two teams to compare. The y-axis of the plots represents the number of stats to compare.

Plot to compare team pitchers stats - compare_pitcher_statistic_teams

This function draws a plot through comparing the pitching stats of team. This function returns plots using the ggplot facet_wrap function for the team's pitching statistics. The pitching stats of both teams are compared against each other and displayed as a bar graph. The x-axis of plots represents the two teams to compare. The y-axis of the plots represents stats to compare.

Cautions when using the above functions

This functions have a 'yearly', 'monthly' parameter. If you put a value that is not suitable for these parameters, an error occurs. For example, an error occurs when you try to compare a season that is not in the data. To prevent errors, you need to be clear about what season the data is about.



choosunsick/kbodatamining documentation built on May 18, 2019, 1:30 p.m.