penaltyPlot {footballpenaltiesBL} | R Documentation |
Plot an overview of all penalties taken by or against a men's Bundesliga player.
Description
Search for a player – either exact match or using fixed regular expressions – and create a plot of all penalties taken by or against this player as table with the date on the x-axis and the result on the y-axis.
Usage
penaltyPlot(player, goalkeeper = TRUE, exact = TRUE, pendat, includeMisses = TRUE,
quarterlyAxis = TRUE, colours = NULL, main = NULL, sub = NULL, jitter = TRUE,
yvalconst = FALSE)
Arguments
player |
Character vector of length 1 which contains the full name of a player in |
goalkeeper |
Boolean, specifies whether |
exact |
Boolean, specifies whether to look for an exact match. If set to FALSE,
|
pendat |
Name of a data set containing the penalties. The data set needs to follow the
format of |
includeMisses |
Boolean, indicates whether to include penalties that missed the goal without the goalkeeper actively saving the ball. |
quarterlyAxis |
Boolean, to customise the x-axis. If TRUE, the beginning of every quarter of each year will be included on the axis, if FALSE, only the beginning of each year will be marked. |
colours |
Vector of length 3 that indicate the colours for saves, misses, and goals. The default value tries to reflect the relative success of each outcome for goalkeepers and penalty takers. |
main |
Main title of the plot. The default indicates who the penalties were taken by or against. |
sub |
Subtitle of the plot. The defaults indicates whether missed shots were included or not. |
jitter |
Boolean, should observations be jittered along the y-axis to avoid overlap? |
yvalconst |
Boolean, if TRUE, all penalties are plotted with a constant y-value (jitter may be added
afterwards if |
Value
No value is returned, function is called for its side-effect of producing a plot.
Author(s)
Leo N. Geppert, with thanks to Marius Ötting for the inspiration.
See Also
penaltyPrint
Examples
data(penalties)
# Basic goalkeeper plot with quarterly and yearly marks. Depending on the duration of the career,
# quarterly marks may be too cluttered.
penaltyPlot('Illgner', pendat = penalties, exact = FALSE)
penaltyPlot('Illgner', pendat = penalties, exact = FALSE, quarterly = FALSE)
# similar plot for a penalty taker
penaltyPlot('Polster', pendat = penalties, exact = FALSE, quarterly = FALSE, goalkeeper = FALSE)
# demonstrate the effect of keeping the value on the y-axis constant as well as of excluding misses
penaltyPlot('Neuer', pendat = penalties, exact = FALSE, quarterly = FALSE)
penaltyPlot('Neuer', pendat = penalties, exact = FALSE, quarterly = FALSE, yvalconst = TRUE)
penaltyPlot('Neuer', pendat = penalties, exact = FALSE, quarterly = FALSE, includeMisses = FALSE)