Title: | Plot Scaled 'ggplot' Representations of Sports Playing Surfaces |
Version: | 2.2.2 |
Description: | Create scaled 'ggplot' representations of playing surfaces. Playing surfaces are drawn pursuant to rule-book specifications. This package should be used as a baseline plot for displaying any type of tracking data. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.3 |
Imports: | ggfittext, ggplot2, glue, grid, rlang |
Depends: | R (≥ 3.3) |
Suggests: | data.table, gganimate, testthat (≥ 3.0.0), knitr, rmarkdown, curl |
Config/testthat/edition: | 3 |
URL: | https://sportyr.sportsdataverse.org/, https://github.com/sportsdataverse/sportyR |
BugReports: | https://github.com/sportsdataverse/sportyR/issues |
VignetteBuilder: | knitr |
SystemRequirements: | pandoc (>= 1.12.3), pandoc-citeproc |
NeedsCompilation: | no |
Packaged: | 2024-02-15 09:40:43 UTC; rossdrucker |
Author: | Ross Drucker |
Maintainer: | Ross Drucker <ross.a.drucker@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-02-15 10:10:02 UTC |
Set the default value when not provided in a list
Description
Set the default value when not provided in a list
Usage
spec_val %or% default_val
Arguments
spec_val |
The specified value to use (assuming it's provided) |
default_val |
The value to use as the default |
Value
A value dependent on if the left-hand value is provided, or the default value specified on the right hand side
One of the bases on the diamond, or really any base on the field. These are squares that are rotated 45 degrees
Description
One of the bases on the diamond, or really any base on the field. These are squares that are rotated 45 degrees
Usage
baseball_base(
base_side_length = 0,
adjust_x_left = FALSE,
adjust_x_right = FALSE
)
Arguments
base_side_length |
The length of each side of the base |
adjust_x_left |
Whether or not the base should be adjusted in the -x direction (e.g. third base) |
adjust_x_right |
Whether or not the base should be adjusted in the +x direction (e.g. first base) |
Value
A data frame that comprises the boundary of the base
The batter's boxes on the field. This is where a batter must stand to legally hit the ball
Description
The batter's boxes on the field. This is where a batter must stand to legally hit the ball
Usage
baseball_batters_box(
batters_box_length = 0,
batters_box_width = 0,
batters_box_y_adj = 0,
batters_box_thickness = 0
)
Arguments
batters_box_length |
The length of the batter's box (in the y direction) measured from the outside of the chalk lines |
batters_box_width |
The width of the batter's box (in the x direction) measured from the outside of the chalk lines |
batters_box_y_adj |
The shift off of center in the y direction that the batter's box is to be moved to properly align |
batters_box_thickness |
The thickness of the chalk lines that comprise the batter's box |
Value
A data frame of the batter's box
The catcher's box. This is where the catcher is located on defense, usually
marked by two white lines and a back line as well. The box may take various
shapes, which are controlled by the catchers_box_shape
parameter
Description
The catcher's box. This is where the catcher is located on defense, usually
marked by two white lines and a back line as well. The box may take various
shapes, which are controlled by the catchers_box_shape
parameter
Usage
baseball_catchers_box(
catchers_box_depth = 0,
catchers_box_width = 0,
batters_box_length = 0,
batters_box_y_adj = 0,
catchers_box_shape = "rectangle",
catchers_box_thickness = 0,
home_plate_circle_radius = 0
)
Arguments
catchers_box_depth |
The distance from the back tip of home plate to the back edge of the catcher's box |
catchers_box_width |
The distance between the outer edges of the catcher's box at the widest point |
batters_box_length |
The length of the batter's box (in the y direction) measured from the outside of the chalk lines |
batters_box_y_adj |
The shift off of center in the y direction that the batter's box is to be moved to properly align |
catchers_box_shape |
A string representing the shape of the catcher's box to draw |
catchers_box_thickness |
The thickness of the chalk lines that comprise the catcher's box |
home_plate_circle_radius |
The radius of the circle around home plate |
Value
A data frame containing the bounding box of the catcher's box
Set the colors to be used for the plot. The values provided in the arguments are the defaults, and, where specified, are the rule-book specified values.
Description
Hexadecimal values are the passed vales to this function by default, but it
is also possible to use string-named values (e.g. "dodgerblue"
) when
specifying.
Usage
baseball_features_set_colors(
plot_background = "#395d33",
infield_dirt = "#9b7653",
infield_grass = "#395d33",
pitchers_mound = "#9b7653",
base = "#ffffff",
pitchers_plate = "#ffffff",
batters_box = "#ffffff",
catchers_box = "#ffffff",
foul_line = "#ffffff",
running_lane = "#ffffff"
)
Arguments
plot_background |
A hexadecimal string representing the color to use for this feature |
infield_dirt |
A hexadecimal string representing the color to use for this feature |
infield_grass |
A hexadecimal string representing the color to use for this feature |
pitchers_mound |
A hexadecimal string representing the color to use for this feature |
base |
A hexadecimal string representing the color to use for this feature |
pitchers_plate |
A hexadecimal string representing the color to use for this feature |
batters_box |
A hexadecimal string representing the color to use for this feature |
catchers_box |
A hexadecimal string representing the color to use for this feature |
foul_line |
A hexadecimal string representing the color to use for this feature |
running_lane |
A hexadecimal string representing the color to use for this feature |
Value
A list of hexadecimal colors to use to color the features on the resulting plot
The foul line. These are the white lines that extend from the back tip of home plate (but not visibly through the batter's boxes) out to the fair/foul pole in the outfield. Since a ball on the line is considered in fair territory, the outer edge of the baseline must lie in fair territory (aka the line y = +/- x)
Description
The foul line. These are the white lines that extend from the back tip of home plate (but not visibly through the batter's boxes) out to the fair/foul pole in the outfield. Since a ball on the line is considered in fair territory, the outer edge of the baseline must lie in fair territory (aka the line y = +/- x)
Usage
baseball_foul_line(
is_line_1b = FALSE,
line_distance = 0,
batters_box_length = 0,
batters_box_width = 0,
batters_box_y_adj = 0,
home_plate_side_to_batters_box = 0,
foul_line_thickness = 0
)
Arguments
is_line_1b |
Whether or not the line is the first base line |
line_distance |
The straight-line distance from the back tip of home plate to the terminus of the line at the foul pole |
batters_box_length |
The length of the batter's box (in the y direction) measured from the outside of the chalk lines |
batters_box_width |
The width of the batter's box (in the x direction) measured from the outside of the chalk lines |
batters_box_y_adj |
The shift off of center in the y direction that the batter's box is to be moved to properly align |
home_plate_side_to_batters_box |
The distance from the outer edge of the batter's box to the inner edge of home plate |
foul_line_thickness |
The thickness of the chalk line that comprise the foul line |
Value
A data frame containing the foul line's bounding coordinates
Home plate. This is a pentagonal shape with its back tip located at the origin of the coordinate system. The angled sides of home plate intersect the baselines
Description
Home plate. This is a pentagonal shape with its back tip located at the origin of the coordinate system. The angled sides of home plate intersect the baselines
Usage
baseball_home_plate(home_plate_edge_length = 0)
Arguments
home_plate_edge_length |
The length of a single edge of home plate |
Value
A data frame that contains the boundary of home plate
The dirt that comprises the infield. This includes the base paths, infield arc, and home plate circle.
Description
The home plate circle may be drawn over in other shapes as needed (example: Detroit's Comerica Park has a home plate shaped dirt area as the home plate "circle")
Usage
baseball_infield_dirt(
home_plate_circle_radius = 0,
foul_line_to_foul_grass = 0,
pitchers_plate_distance = 0,
infield_arc_radius = 0
)
Arguments
home_plate_circle_radius |
The radius of the circle around home plate |
foul_line_to_foul_grass |
The distance from the outer edge of the foul line to the inner edge of the grass in foul territory |
pitchers_plate_distance |
The distance from the back tip of home plate to the front edge of the pitcher's plate |
infield_arc_radius |
The distance from the front edge of the pitcher's plate to the back of the infield dirt |
Value
A data frame that comprises the entirety of the infield dirt and dirt circles around home plate
The dirt that comprises the infield grass. This is the area inside the lines drawn by the basepaths
Description
The dirt that comprises the infield grass. This is the area inside the lines drawn by the basepaths
Usage
baseball_infield_grass(
home_plate_circle_radius = 0,
foul_line_to_infield_grass = 0,
baseline_distance = 0,
base_anchor_to_infield_grass = 0
)
Arguments
home_plate_circle_radius |
The radius of the circle around home plate |
foul_line_to_infield_grass |
The distance from the outer edge of the foul line to the inner edge of the infield grass |
baseline_distance |
The distance from the back tip of home plate to the back corner of either first or third base along the foul line |
Value
A data frame that comprises the entirety of the infield grass
The pitcher's mound. This is where the pitcher's plate is located, but the pitcher's plate is not necessarily centered on the pitcher's mound
Description
The pitcher's mound. This is where the pitcher's plate is located, but the pitcher's plate is not necessarily centered on the pitcher's mound
Usage
baseball_pitchers_mound(pitchers_mound_radius = 0)
Arguments
pitchers_mound_radius |
The radius of the pitcher's mound |
Value
A data frame of the pitcher's mound's bounding coordinates
The pitcher's plate. This is where the pitcher must throw the ball from. It's usually a long rectangle with its front edge as its anchor point
Description
The pitcher's plate. This is where the pitcher must throw the ball from. It's usually a long rectangle with its front edge as its anchor point
Usage
baseball_pitchers_plate(pitchers_plate_length = 0, pitchers_plate_width = 0)
Arguments
pitchers_plate_length |
the length (x-direction) of the pitcher's plate |
pitchers_plate_width |
the width (y-direction) of the pitcher's plate |
Value
A data frame of the pitcher's plate's bounding coordinates
The running lane is entirely in foul territory. The depth should be measured from the foul-side edge of the baseline to the outer edge of the running lane mark
Description
All measurements should be given "looking down the line" (e.g. as they would be measured by an observer standing behind home plate)
Usage
baseball_running_lane(
running_lane_depth = 0,
running_lane_length = 0,
running_lane_start_distance = 0,
running_lane_thickness = 0
)
Arguments
running_lane_depth |
The distance from the outer edge of the foul line to the outer edge of the running lane |
running_lane_length |
The total distance of the running lane, from where it first starts to its terminus near first base |
running_lane_start_distance |
The distance from the back tip of home plate that the running lane starts |
running_lane_thickness |
The thickness of the chalk line that comprises the running lane |
Value
A data frame containing the running lane's bounding coordinates
The backboard is the backing onto which the basket ring (created by
basketball_basket_ring()
) is affixed. This will be drawn as a
rectangle on the court as the court is drawn from an aerial view
Description
The backboard is the backing onto which the basket ring (created by
basketball_basket_ring()
) is affixed. This will be drawn as a
rectangle on the court as the court is drawn from an aerial view
Usage
basketball_backboard(backboard_width = 0, backboard_thickness = 0)
Arguments
backboard_width |
The width of the backboard when viewed from above. This is the x-direction dimension of the backboard when taking the point of view of a free throw shooter |
backboard_thickness |
The thickness of the backboard when viewed from above |
Value
A data frame of the bounding box of the backboard
The hoop through which the ball must pass to score points for a team is called the basket ring
Description
An explanation of the math used to generate the basket ring (and its connecting portion that attaches the ring to the backboard) is walked through below using NBA dimensions, but is generalized in the code
Usage
basketball_basket_ring(
basket_ring_connector_width = 0,
backboard_face_to_ring_cent = 0,
basket_ring_inner_radius = 0,
basket_ring_thickness = 0
)
Arguments
basket_ring_connector_width |
The width of the basket ring connector |
backboard_face_to_ring_cent |
How far off the face of the backboard the center of the basket ring's circle is located |
basket_ring_inner_radius |
The inner radius of the circular part of the basket ring |
basket_ring_thickness |
The thickness of the basket ring's circular part |
Details
The connector has a width of 7", so 3.5" are on each side of the x axis. The ring has a radius of 9", so the arcsine of these measurements should give the angle at which point the ring and connector connect
Value
A data frame of the boundary of the basket ring and connector
The center circle is broken into two parts: the
basketball_center_circle_outline()
, and the fill (this feature), which is
the court coloring inside of the inner edge of this circle
Description
The center circle is broken into two parts: the
basketball_center_circle_outline()
, and the fill (this feature), which is
the court coloring inside of the inner edge of this circle
Usage
basketball_center_circle_fill(center_circle_radius = 0, line_thickness = 0)
Arguments
center_circle_radius |
The outer radius of the center circle |
line_thickness |
The thickness of the line that comprises the center circle |
Value
A data frame of the boundary of the center circle. The interior of these coordinates correspond to the filled section
The center circle is broken into two parts: the outline (this feature) and the fill, which is the court coloring inside of the inner edge of this circle
Description
The center circle is broken into two parts: the outline (this feature) and the fill, which is the court coloring inside of the inner edge of this circle
Usage
basketball_center_circle_outline(center_circle_radius = 0, line_thickness = 0)
Arguments
center_circle_radius |
The outer radius of the center circle |
line_thickness |
The thickness of the line that comprises the center circle |
Value
A data frame of the boundary of the center circle
The apron of the court is the colored boundary around the exterior of some courts. If no such colored boundary exists, this should take the same color as the court floor
Description
The apron of the court is the colored boundary around the exterior of some courts. If no such colored boundary exists, this should take the same color as the court floor
Usage
basketball_court_apron(
court_length = 0,
court_width = 0,
court_apron_endline = 0,
court_apron_sideline = 0,
court_apron_to_boundary = 0,
line_thickness = 0
)
Arguments
court_length |
The length of the court |
court_width |
The width of the court |
court_apron_endline |
The thickness of the court's apron beyond the endline |
court_apron_sideline |
The thickness of the court's apron beyond the sideline |
court_apron_to_boundary |
The distance from the inner edge of the court apron to the outer edge of the court's boundary line (sideline and endline will be spaced the same) |
line_thickness |
The thickness of the endline and sideline |
Value
A data frame of the bounding coordinates of the court apron
The division line divides the court into two halves, and is sometimes referred to as the time line or half-court line. The center of this line goes through the y axis, with half of the line lying in a team's offensive half court and the other half in their defensive half court
Description
The division line divides the court into two halves, and is sometimes referred to as the time line or half-court line. The center of this line goes through the y axis, with half of the line lying in a team's offensive half court and the other half in their defensive half court
Usage
basketball_division_line(
court_width = 0,
line_thickness = 0,
division_line_extension = 0
)
Arguments
court_width |
The width of the court |
line_thickness |
The thickness of the division line |
division_line_extension |
The distance that the division line extends beyond the sideline. This may be omitted if the value is 0 |
Value
A data frame of the bounding box for the division line of the court
The endline on a basketball court, also called the baseline, is located
beyond each basket. In cases where the endline is the court apron, the
endline should still be generated and its color should be set equal to the
court apron's color (see basketball_court_apron()
for more information on
the court apron)
Description
The endline on a basketball court, also called the baseline, is located
beyond each basket. In cases where the endline is the court apron, the
endline should still be generated and its color should be set equal to the
court apron's color (see basketball_court_apron()
for more information on
the court apron)
Usage
basketball_endline(court_width = 0, line_thickness = 0)
Arguments
court_width |
The width of the court |
line_thickness |
The thickness of the endline and sideline |
Value
A data frame of the bounding coordinates of the endline
Set the colors to be used for the plot. The values provided in the arguments are the defaults, and, where specified, are the rule-book specified values.
Description
Hexadecimal values are the passed vales to this function by default, but it
is also possible to use string-named values (e.g. "dodgerblue"
) when
specifying.
Usage
basketball_features_set_colors(
plot_background = NULL,
defensive_half_court = "#d2ab6f",
offensive_half_court = "#d2ab6f",
court_apron = "#d2ab6f",
center_circle_outline = "#000000",
center_circle_fill = "#d2ab6f",
division_line = "#000000",
endline = "#000000",
sideline = "#000000",
two_point_range = "#d2ab6f",
three_point_line = "#000000",
painted_area = "#d2ab6f",
lane_boundary = "#000000",
free_throw_circle_outline = "#000000",
free_throw_circle_fill = "#d2ab6f",
free_throw_circle_dash = "#000000",
lane_space_mark = "#000000",
inbounding_line = "#000000",
substitution_line = "#000000",
baseline_lower_defensive_box = "#000000",
lane_lower_defensive_box = "#000000",
team_bench_line = "#000000",
restricted_arc = "#000000",
backboard = "#000000",
basket_ring = "#f55b33",
net = "#ffffff"
)
Arguments
plot_background |
A hexadecimal string representing the color to use for this feature |
defensive_half_court |
A hexadecimal string representing the color to use for this feature |
offensive_half_court |
A hexadecimal string representing the color to use for this feature |
court_apron |
A hexadecimal string representing the color to use for this feature |
center_circle_outline |
A hexadecimal string representing the color to use for this feature |
center_circle_fill |
A hexadecimal string representing the color to use for this feature |
division_line |
A hexadecimal string representing the color to use for this feature |
endline |
A hexadecimal string representing the color to use for this feature |
sideline |
A hexadecimal string representing the color to use for this feature |
two_point_range |
A hexadecimal string representing the color to use for this feature |
three_point_line |
A hexadecimal string representing the color to use for this feature |
painted_area |
A hexadecimal string representing the color to use for this feature |
lane_boundary |
A hexadecimal string representing the color to use for this feature |
free_throw_circle_outline |
A hexadecimal string representing the color to use for this feature |
free_throw_circle_fill |
A hexadecimal string representing the color to use for this feature |
free_throw_circle_dash |
A hexadecimal string representing the color to use for this feature |
lane_space_mark |
A hexadecimal string representing the color to use for this feature |
inbounding_line |
A hexadecimal string representing the color to use for this feature |
substitution_line |
A hexadecimal string representing the color to use for this feature |
baseline_lower_defensive_box |
A hexadecimal string representing the color to use for this feature |
lane_lower_defensive_box |
A hexadecimal string representing the color to use for this feature |
team_bench_line |
A hexadecimal string representing the color to use for this feature |
restricted_arc |
A hexadecimal string representing the color to use for this feature |
backboard |
A hexadecimal string representing the color to use for this feature |
basket_ring |
A hexadecimal string representing the color to use for this feature |
net |
A hexadecimal string representing the color to use for this feature |
Value
A list of hexadecimal colors to use to color the features on the resulting plot
The outline of the free throw circle. The interior filling area is created
via basketball_free_throw_circle_fill()
Description
The outline of the free throw circle. The interior filling area is created
via basketball_free_throw_circle_fill()
Usage
basketball_free_throw_circle(
overhang = 0,
free_throw_circle_radius = 0,
line_thickness = 0
)
Arguments
overhang |
The arc length of the free throw circle that hangs past the free throw line |
free_throw_circle_radius |
The radius of the free throw circle |
line_thickness |
The thickness of the free throw line |
Value
A data frame of the bounding coordinates of the free throw circle
On some courts, there are a series of dashes that comprise the bottom half of the free throw circle (e.g. the half closer to the basket). This function generates a single dash
Description
On some courts, there are a series of dashes that comprise the bottom half of the free throw circle (e.g. the half closer to the basket). This function generates a single dash
Usage
basketball_free_throw_circle_dash(
feature_radius = 0,
line_thickness = 0,
start_angle = 0,
end_angle = 0
)
Arguments
feature_radius |
The radius of the free throw circle |
line_thickness |
The thickness of the dash |
start_angle |
The angle, in |
end_angle |
The angle, in |
Value
A data frame containing the bounding coordinates of a dash on the free throw circle
The filled-in section of the free throw circle. The circle is the area where
a free throw shooter stands when attempting the free throw. The outline of
this area will be created separately via
basketball_free_throw_circle()
Description
The filled-in section of the free throw circle. The circle is the area where
a free throw shooter stands when attempting the free throw. The outline of
this area will be created separately via
basketball_free_throw_circle()
Usage
basketball_free_throw_circle_fill(
free_throw_circle_radius = 0,
line_thickness = 0
)
Arguments
free_throw_circle_radius |
The outer radius of the free throw circle, measured from the center of the free throw line |
line_thickness |
The thickness of the outline of the free throw circle |
Value
A data frame containing the bounding coordinates of the free throw circle's semi-circular filling
The lines providing the boundary to the free throw lane. When a player is shooting a free throw, all non-shooting players must be outside of this boundary
Description
NOTE: This does not include lane space markings (blocks), which will be
created via basketball_lane_space_mark()
.
Usage
basketball_free_throw_lane_boundary(
lane_length = 0,
lane_width = 0,
line_thickness = 0
)
Arguments
lane_length |
The length of the free throw lane |
lane_width |
The width of the free throw |
line_thickness |
The thickness of the free throw lane boundary |
Value
A data frame of the bounding coordinates of the free throw lane boundary
Each half court spans from the inner edge of the baseline to the center of the division line, and serves as the base layer of the court plot
Description
Each half court spans from the inner edge of the baseline to the center of the division line, and serves as the base layer of the court plot
Usage
basketball_half_court(court_length = 0, court_width = 0)
Arguments
court_length |
The length of the court |
court_width |
The width of the court |
Value
A data frame of the bounding box of half a basketball court
The inbounding line is where the ball is inbounded on the sideline when necessary. Lines drawn on the top of the court should be drawn in a top-down direction, and lines on the bottom of the court should be drawn in the bottom-up direction
Description
The inbounding line is where the ball is inbounded on the sideline when necessary. Lines drawn on the top of the court should be drawn in a top-down direction, and lines on the bottom of the court should be drawn in the bottom-up direction
Usage
basketball_inbounding_line(
line_thickness = 0,
in_play_ext = 0,
out_of_bounds_ext = 0,
drawn_direction = ""
)
Arguments
line_thickness |
The thickness of the inbounding line |
in_play_ext |
The extension of the inbounding line into the court |
out_of_bounds_ext |
The extension of the inbounding line away from the court |
drawn_direction |
A string indicating which way, in an un-rotated plot, the line should be drawn when looking at the plot in TV View |
Value
A data frame containing the bounding box of the inbounding line
The lane space marks, also known as the blocks, denote where non-shooting players stand during free throws. Players may not cross these lines before the ball touches the rim on the shot attempt
Description
The lane space marks, also known as the blocks, denote where non-shooting players stand during free throws. Players may not cross these lines before the ball touches the rim on the shot attempt
Usage
basketball_lane_space_mark(feature_thickness = 0, mark_depth = 0)
Arguments
feature_thickness |
The thickness of the lane space mark (this is the
distance in the |
mark_depth |
The distance from the exterior edge of the free throw lane boundary that the lane space mark extends towards the sideline |
Value
A data frame containing the bounding box of the lane space mark
The lower defensive box is an imaginary box on the court extending from the lines on the baseline to the lines inside the painted area. This box helps determine when a block/charge call should take place, as an offensive player is entitled to move outside of (and subsequently enter) this box without contact
Description
The lower defensive box is an imaginary box on the court extending from the lines on the baseline to the lines inside the painted area. This box helps determine when a block/charge call should take place, as an offensive player is entitled to move outside of (and subsequently enter) this box without contact
Usage
basketball_lower_defensive_box_mark(
drawn_direction = "",
extension = 0,
line_thickness = 0
)
Arguments
drawn_direction |
A string indicating which way to draw the lower defensive box mark |
extension |
The amount that the lower defensive box mark extends in the drawn direction |
line_thickness |
The thickness of the line representing the lower defensive box |
Value
A data frame of the bounding box of a lower defensive box marking
To make the basket ring easier to identify, the nets will also be drawn onto the plot. They will typically be white in color
Description
To make the basket ring easier to identify, the nets will also be drawn onto the plot. They will typically be white in color
Usage
basketball_net(basket_ring_inner_radius = 0)
Arguments
basket_ring_inner_radius |
The radius of the interior of the basket ring |
Value
A data frame of the net's circular outline
The painted area is the area contained by the free throw lane (see
basketball_free_throw_lane_boundary()
for more information on the free
throw lane)
Description
The painted area may be a different color than the rest of the two point
range area (see basketball_two_point_range()
for more information on
two-point range), but may also be the same color
Usage
basketball_painted_area(
lane_length = 0,
lane_width = 0,
paint_margin = 0,
line_thickness = 0
)
Arguments
lane_length |
The length of the free throw lane |
lane_width |
The width of the free throw |
paint_margin |
The distance from the painted area of the lane to the free throw lane boundary lines |
line_thickness |
The thickness of the line of the free throw lane boundary line |
Value
A data frame of the bounding coordinates of the free throw lane's painted area
The arc located in the free-throw lane is called the restricted arc. The interior radius should be specified for this feature.
Description
The arc located in the free-throw lane is called the restricted arc. The interior radius should be specified for this feature.
Usage
basketball_restricted_arc(
feature_radius = 0,
line_thickness = 0,
backboard_to_center_of_basket = 0
)
Arguments
feature_radius |
The interior radius of the restricted arc |
line_thickness |
The thickness of the restricted arc line |
backboard_to_center_of_basket |
The distance from the backboard to the center of the basket |
Value
A data frame containing the bounding coordinates of the restricted arc
The sideline on a basketball court run the full length of the court,
typically with the team bench areas and substitution areas on their exterior.
In cases where the sideline is the court apron, the sideline should still be
generated and its color should be set equal to the court apron's color (see
basketball_court_apron()
for more information on the court apron)
Description
The sideline on a basketball court run the full length of the court,
typically with the team bench areas and substitution areas on their exterior.
In cases where the sideline is the court apron, the sideline should still be
generated and its color should be set equal to the court apron's color (see
basketball_court_apron()
for more information on the court apron)
Usage
basketball_sideline(court_length = 0, line_thickness = 0)
Arguments
court_length |
The length of the court |
line_thickness |
The thickness of the endline and sideline |
Value
A data frame of the bounding coordinates of the sideline
The substitution line is where players checking into the game wait for a stoppage. Lines drawn on the top of the court should be drawn in a top-down direction, and lines on the bottom of the court should be drawn in the bottom-up direction
Description
The substitution line is where players checking into the game wait for a stoppage. Lines drawn on the top of the court should be drawn in a top-down direction, and lines on the bottom of the court should be drawn in the bottom-up direction
Usage
basketball_substitution_line(
line_thickness = 0,
substitution_line_width = 0,
drawn_direction = ""
)
Arguments
line_thickness |
The thickness of the substitution line |
substitution_line_width |
The width of the substitution line, from top to bottom when viewing the plot in TV view |
drawn_direction |
A string indicating which way, in an un-rotated plot, the line should be drawn when looking at the plot in TV View |
Value
A data frame containing the bounding coordinates of the substitution line
Players not in the game must stay within the team bench lines unless moving
to the substitution area (see basketball_substitution_line()
class)
Description
Players not in the game must stay within the team bench lines unless moving
to the substitution area (see basketball_substitution_line()
class)
Usage
basketball_team_bench_line(
line_thickness = 0,
extension = 0,
drawn_direction = ""
)
Arguments
line_thickness |
The thickness of the team bench line |
extension |
The extension of the team bench line out of the court |
drawn_direction |
A string indicating which way, in an un-rotated plot, the line should be drawn when looking at the plot in TV View |
Value
A data frame containing the bounding coordinates of the team bench line
An arc on the court, behind which any made basket counts as three points and
in front of which, any made basket will count as two points (see
basketball_two_point_range()
for more information).
Description
Start by getting the distance from the center of the basket to a corner
three-point shot. This is referred to as start_y
Usage
basketball_three_point_line(
basket_center_to_baseline = 0,
basket_center_to_corner_three = 0,
line_thickness = 0,
three_point_line_radius = 0
)
Arguments
basket_center_to_baseline |
The distance from the center of the basket ring to the inner edge of the baseline |
basket_center_to_corner_three |
The distance from the center of the basket ring to the outer edge of the three-point line in the corner in the court's specified units |
line_thickness |
The thickness of the three-point line |
three_point_line_radius |
The outer radius of the arc portion of the three-point line |
Details
Next, get the starting angle with which to trace out the two-point range.
Taking the distance start_y to be a y coordinate, and the radius of the arc
of the three-point line to be a radius, we the sine of the starting angle is
given as start_y / three_point_arc_radius
As the TV-right angle of the start of the arc is what's drawn here, the
starting and ending angles need to be adjusted relative to 1 radian (the arc
opens to the right, like a (
character)
The starting angle is therefore given as 1 - angle
, and the ending
angle is 1 + angle
Value
A data frame of the bounding coordinates of the three-point line
If a court has a three-point line (see basketball_three_point_line()
), then
any made basket (not including free throws) made from inside of the arc are
worth two points. The area inside of this arc is therefore referred to as two
point range, which this feature draws. This feature is enclosed by the
three-point line's outer edge and the baseline's inner edge
Description
It should also be noted that as this corresponds strictly to the area contained by the three-point line, the interior angle is what's needed. While utilizing the corner-three distance as the outer edge should work generally, an issue may arise if the z-order of the feature's plotting characteristic is changed to be greater than that of the three-point line itself. This should not happen, but the interior edge is therefore what is used here
Usage
basketball_two_point_range(
basket_center_to_baseline = 0,
basket_center_to_corner_three = 0,
line_thickness = 0,
two_point_range_radius = 0
)
Arguments
basket_center_to_baseline |
The distance from the center of the basket ring to the inner edge of the baseline |
basket_center_to_corner_three |
The distance from the center of the basket ring to the outer edge of the three-point line in the corner in the court's specified units |
line_thickness |
The thickness of the three-point line |
two_point_range_radius |
The radius of the arc portion of the three-point line |
Details
Start by getting the distance from the center of the basket to a corner
three-point shot. This is referred to as start_y
Next, get the starting angle with which to trace out the two-point range.
Taking the distance start_y to be a y coordinate, and the (outer) radius of
the arc of the three-point line to be a radius, we the sine of the starting
angle is given as start_y / {three_point_arc_radius -
three_point_line_thickness}
As the TV-right angle of the start of the arc is what's drawn here, the
starting and ending angles need to be adjusted relative to 1 radian (the arc
opens to the right, like a (
character)
The starting angle is therefore given as 1 - angle
, and the ending
angle is 1 + angle
Value
A data frame of the bounding coordinates of two-point range
Check to see what features of a surface can be colored
Description
Check to see what features of a surface can be colored
Usage
cani_color_league_features(league_code, sport_name = NULL)
Arguments
league_code |
The case-insensitive league code to be plotted |
sport_name |
The name of a sport to use in the event that the
|
Value
Nothing, but a message is sent to the console
Examples
cani_color_league_features("NCAA", "basketball")
Check to see if a league can be plotted, and alert as to which function(s) that league will work for
Description
Check to see if a league can be plotted, and alert as to which function(s) that league will work for
Usage
cani_plot_league(league_code)
Arguments
league_code |
The case-insensitive league code to be plotted |
Value
Nothing, but a message is sent to the console
Examples
cani_plot_league("MLB")
Check to see if a sport can be plotted, and alert as to which league(s) are plottable for the sport
Description
Check to see if a sport can be plotted, and alert as to which league(s) are plottable for the sport
Usage
cani_plot_sport(sport_code)
Arguments
sport_code |
The case-insensitive sport name |
Value
Nothing, but a message is sent to the console
Examples
cani_plot_sport("basketball")
Convert all units, regardless of starting and ending units
Description
Convert all units, regardless of starting and ending units
Usage
convert_units(meas, from_unit, to_unit, conversion_columns = NULL)
Arguments
meas |
A measurement in any unit of length |
from_unit |
A string containing the original unit of measure to be converted |
to_unit |
A string containing the ending unit of measure |
conversion_columns |
A vector containing the columns to convert if
|
Value
The measurement in converted units
Examples
convert_units(1, "in", "cm")
convert_units(100, "cm", "m")
The back line is the line in the back of the house. Its outer edge should be used as its anchor point
Description
The back line is the line in the back of the house. Its outer edge should be used as its anchor point
Usage
curling_back_line(line_thickness = 0, sheet_width = 0)
Arguments
line_thickness |
The thickness of the back line |
sheet_width |
The width of the curling sheet, from side wall to side wall |
Value
A data frame containing the bounding box of the back line
The inner-most of the concentric circles comprising the house is called the
button. This is the intersection of the tee line (see curling_tee_line()
)
and the centre line (see curling_centre_line()
)
Description
The inner-most of the concentric circles comprising the house is called the
button. This is the intersection of the tee line (see curling_tee_line()
)
and the centre line (see curling_centre_line()
)
Usage
curling_button(feature_radius = 0)
Arguments
feature_radius |
The radius of the button |
Value
A data frame containing the bounding coordinates of the button
The centre line is the line that runs the full length of the curling sheet,
or the line x = 0
in TV view
Description
The centre line is the line that runs the full length of the curling sheet,
or the line x = 0
in TV view
Usage
curling_centre_line(
line_thickness = 0,
tee_line_to_center = 0,
centre_line_extension = 0
)
Arguments
line_thickness |
The thickness of the centre line |
tee_line_to_center |
The distance between the tee lines. (See
|
centre_line_extension |
The distance beyond the tee lines that the centre line extends |
Value
A data frame containing the bounding coordinates of the centre line
The curling sheet is the entire sheet, with the houses at either the top or bottom ends. This draws the area between the hog lines
Description
The curling sheet is the entire sheet, with the houses at either the top or bottom ends. This draws the area between the hog lines
Usage
curling_centre_zone(
sheet_width = 0,
tee_line_to_center = 0,
hog_line_to_tee_line = 0
)
Arguments
sheet_width |
The width of the curling sheet, from side wall to side wall |
tee_line_to_center |
The distance from the tee line to the center of the sheet |
hog_line_to_tee_line |
The distance from the center of the tee line to the interior edge of the tee line |
Value
A data frame containing the bounding box of the end of the ice sheet
The courtesy lines are where players stand during the delivery process of each stone when the opposing team is throwing
Description
The courtesy lines are where players stand during the delivery process of each stone when the opposing team is throwing
Usage
curling_courtesy_line(line_thickness = 0, line_length = 0)
Arguments
line_thickness |
The thickness of the courtesy line |
line_length |
The length of the courtesy line, from the side wall towards the centre line |
Value
A data frame containing the bounding box of the courtesy line
The curling sheet is the entire sheet, with the houses at either the top or bottom ends. This draws the area of the sheet from the hog line to the back board
Description
The curling sheet is the entire sheet, with the houses at either the top or bottom ends. This draws the area of the sheet from the hog line to the back board
Usage
curling_end(
sheet_length = 0,
sheet_width = 0,
tee_line_to_center = 0,
hog_line_to_tee_line = 0,
drawn_direction = ""
)
Arguments
sheet_length |
The length of the sheet, from back board to back board |
sheet_width |
The width of the curling sheet, from side wall to side wall |
tee_line_to_center |
The distance from the tee line to the center of the sheet |
hog_line_to_tee_line |
The distance from the center of the tee line to the interior edge of the tee line |
Value
A data frame containing the bounding box of the end of the ice sheet
Set the colors to be used for the plot. The values provided in the arguments are the defaults, and, where specified, are the rule-book specified values.
Description
Hexadecimal values are the passed vales to this function by default, but it
is also possible to use string-named values (e.g. "dodgerblue"
) when
specifying.
Usage
curling_features_set_colors(
plot_background = NULL,
end_1 = "#ffffff",
centre_zone = "#ffffff",
end_2 = "#ffffff",
sheet_apron = "#0033a0",
centre_line = "#000000",
tee_line = "#000000",
back_line = "#000000",
hog_line = "#c8102e",
hack_line = "#000000",
courtesy_line = "#000000",
hack = "#000000",
button = "#ffffff",
house_rings = c("#c8102e", "#ffffff", "#0033a0")
)
Arguments
plot_background |
A hexadecimal string representing the color to use for this feature |
end_1 |
A hexadecimal string representing the color to use for this feature |
centre_zone |
A hexadecimal string representing the color to use for this feature |
end_2 |
A hexadecimal string representing the color to use for this feature |
sheet_apron |
A hexadecimal string representing the color to use for this feature |
centre_line |
A hexadecimal string representing the color to use for this feature |
tee_line |
A hexadecimal string representing the color to use for this feature |
back_line |
A hexadecimal string representing the color to use for this feature |
hog_line |
A hexadecimal string representing the color to use for this feature |
hack_line |
A hexadecimal string representing the color to use for this feature |
courtesy_line |
A hexadecimal string representing the color to use for this feature |
hack |
A hexadecimal string representing the color to use for this feature |
button |
A hexadecimal string representing the color to use for this feature |
house_rings |
A vector of hexadecimal strings representing the color(s) to use for this feature |
Value
A list of hexadecimal colors to use to color the features on the resulting plot
The hack exits on both sides of the curling sheet between the back board and
the back line. This is where a curler pushes off from, and it should be
centered on the centre line (see curling_centre_line()
). This function
draws one of the footholds of the hack
Description
The hack exits on both sides of the curling sheet between the back board and
the back line. This is where a curler pushes off from, and it should be
centered on the centre line (see curling_centre_line()
). This function
draws one of the footholds of the hack
Usage
curling_hack_foothold(foothold_depth = 0, foothold_width = 0)
Arguments
foothold_depth |
The depth of each foothold in the hack, from the side nearest the house to the side nearest the back board |
foothold_width |
The width of each foothold in the hack, from the side nearest the centre line to the side nearest the nearest side wall |
Value
A data frame containing the bounding box of one foothold of the hack
The hack line connects the two footholds at each hack. It should be anchored
at the terminus of the centre line (see curling_centre_line()
for more
information)
Description
The hack line connects the two footholds at each hack. It should be anchored
at the terminus of the centre line (see curling_centre_line()
for more
information)
Usage
curling_hack_line(line_thickness = 0, hack_width = 0)
Arguments
line_thickness |
The thickness of the hack line |
hack_width |
The width of the hack, measured from the outside of one foothold to the outside of the other |
Value
A data frame containing the bounding box of the hack line
The hog line is the line that begins the Free Guard Zone at each end of the ice. Its inner edge (relative to the nearest house) should be used as its anchor point
Description
The hog line is the line that begins the Free Guard Zone at each end of the ice. Its inner edge (relative to the nearest house) should be used as its anchor point
Usage
curling_hog_line(line_thickness = 0, sheet_width = 0)
Arguments
line_thickness |
The thickness of the hog line |
sheet_width |
The width of the curling sheet, from side wall to side wall |
Value
A data frame containing the bounding box of the hog line
The house is comprised of three concentric circles outside of the button of varying radii. This feature is designed to be each of the house rings excluding the button
Description
The house is comprised of three concentric circles outside of the button of varying radii. This feature is designed to be each of the house rings excluding the button
Usage
curling_house_ring(feature_radius = 0)
Arguments
feature_radius |
The radius of the ring |
Value
A data frame containing the bounding coordinates of the house ring
The apron of the sheet is what separates adjacent sheets, and in this context provides a border around the outside of the sheet
Description
The apron of the sheet is what separates adjacent sheets, and in this context provides a border around the outside of the sheet
Usage
curling_sheet_apron(
sheet_length = 0,
sheet_width = 0,
apron_behind_back = 0,
apron_along_side = 0
)
Arguments
sheet_length |
The length of the sheet, from back board to back board |
sheet_width |
The width of the curling sheet, from side wall to side wall |
apron_behind_back |
The extension of the apron beyond the back board |
apron_along_side |
The extension of the apron running along the side walls |
Value
A data frame containing the bounding coordinates of the sheet's apron
The tee line is the line that runs through the center of the house. Its
midpoints are connected by the centre line (see curling_centre_line()
for
more information)
Description
The tee line is the line that runs through the center of the house. Its
midpoints are connected by the centre line (see curling_centre_line()
for
more information)
Usage
curling_tee_line(line_thickness = 0, sheet_width = 0)
Arguments
line_thickness |
The thickness of the tee line |
sheet_width |
The width of the curling sheet, from side wall to side wall |
Value
A data frame containing the bounding box of the tee line
The coaching box is the area between the restricted area and team bench area.
It may or may not be distinct from either of these areas, but is typically
separated by the coaching box line (see football_coaching_box_line()
for
more information on the coaching box line)
Description
The coaching box is the area between the restricted area and team bench area.
It may or may not be distinct from either of these areas, but is typically
separated by the coaching box line (see football_coaching_box_line()
for
more information on the coaching box line)
Usage
football_coaching_box(coaching_box_length = 0, feature_thickness = 0)
Arguments
coaching_box_length |
The length of the coaching box |
feature_thickness |
The depth beyond the exterior edge of the restricted area that the coaching box protrudes |
Value
A data frame of the bounding box of coaching box
The coaching box line is the line that separates the team bench area from the coaching box. This line should be a different color than the bench area and coaching box, which may be the same color
Description
The coaching box line is the line that separates the team bench area from the coaching box. This line should be a different color than the bench area and coaching box, which may be the same color
Usage
football_coaching_box_line(coaching_box_line_length = 0, feature_thickness = 0)
Arguments
coaching_box_line_length |
The length of the line forming the coaching box line |
feature_thickness |
The thickness with which to draw the line |
Value
A data frame of the bounding box of the coaching box line
The directional arrows point towards the nearest goal line from the yardage marker they are closest to. These arrows are described by their base (which runs parallel to the goal line) and their length, which extends from the tip to the base
Description
The directional arrows point towards the nearest goal line from the yardage marker they are closest to. These arrows are described by their base (which runs parallel to the goal line) and their length, which extends from the tip to the base
Usage
football_directional_arrow(arrow_base = 0, arrow_length = 0)
Arguments
arrow_base |
The length of the base of the arrow |
arrow_length |
The length of the arrow from tip to base |
Value
A data frame of the bounding coordinates of the directional arrow
The end line is the line beyond the back of the endzone. Its interior edge is considered out of bounds
Description
The end line is the line beyond the back of the endzone. Its interior edge is considered out of bounds
Usage
football_end_line(feature_thickness = 0, field_width = 0)
Arguments
feature_thickness |
The thickness of the boundary lines |
field_width |
The width of the field |
Value
A data frame of the bounding box of the end line
The endzones are the area beyond the goal line. Any offensive player who is in legal possession of the ball while in the endzone, or who catches the ball in the endzone, scores a touchdown for their team. This area stretches from the back field boundary to the edge of the goal line closest to the center of the field
Description
The endzones are the area beyond the goal line. Any offensive player who is in legal possession of the ball while in the endzone, or who catches the ball in the endzone, scores a touchdown for their team. This area stretches from the back field boundary to the edge of the goal line closest to the center of the field
Usage
football_endzone(field_width = 0, endzone_length = 0)
Arguments
field_width |
The width of the field |
endzone_length |
The length of the endzone |
Value
A data frame of the bounding box of the endzone
Set the colors to be used for the plot. The values provided in the arguments are the defaults, and, where specified, are the rule-book specified values.
Description
Hexadecimal values are the passed vales to this function by default, but it
is also possible to use string-named values (e.g. "dodgerblue"
) when
specifying.
Usage
football_features_set_colors(
plot_background = NULL,
field_apron = "#196f0c",
offensive_half = "#196f0c",
defensive_half = "#196f0c",
offensive_endzone = "#196f0c",
defensive_endzone = "#196f0c",
end_line = "#ffffff",
sideline = "#ffffff",
field_border = "#196f0c",
field_border_outline = "#ffffff00",
red_zone_border = "#196f0c00",
red_zone_border_outline = "#ffffff00",
major_yard_line = "#ffffff",
goal_line = "#ffffff",
minor_yard_line = "#ffffff",
directional_arrow = "#ffffff",
try_mark = "#ffffff",
yardage_marker = "#ffffff",
restricted_area = "#ffffff",
coaching_box = "#ffffff",
team_bench_area = "#196f0c",
team_bench_area_outline = "#ffffff",
coaching_box_line = "#ffcb05"
)
Arguments
plot_background |
A hexadecimal string representing the color to use for this feature |
field_apron |
A hexadecimal string representing the color to use for this feature |
offensive_half |
A hexadecimal string representing the color to use for this feature |
defensive_half |
A hexadecimal string representing the color to use for this feature |
offensive_endzone |
A hexadecimal string representing the color to use for this feature |
defensive_endzone |
A hexadecimal string representing the color to use for this feature |
end_line |
A hexadecimal string representing the color to use for this feature |
sideline |
A hexadecimal string representing the color to use for this feature |
field_border |
A hexadecimal string representing the color to use for this feature |
field_border_outline |
A hexadecimal string representing the color to use for this feature |
red_zone_border |
A hexadecimal string representing the color to use for this feature |
red_zone_border_outline |
A hexadecimal string representing the color to use for this feature |
major_yard_line |
A hexadecimal string representing the color to use for this feature |
goal_line |
A hexadecimal string representing the color to use for this feature |
minor_yard_line |
A hexadecimal string representing the color to use for this feature |
directional_arrow |
A hexadecimal string representing the color to use for this feature |
try_mark |
A hexadecimal string representing the color to use for this feature |
yardage_marker |
A hexadecimal string representing the color to use for this feature |
restricted_area |
A hexadecimal string representing the color to use for this feature |
coaching_box |
A hexadecimal string representing the color to use for this feature |
team_bench_area |
A hexadecimal string representing the color to use for this feature |
team_bench_area_outline |
A hexadecimal string representing the color to use for this feature |
coaching_box_line |
A hexadecimal string representing the color to use for this feature |
Value
A list of hexadecimal colors to use to color the features on the resulting plot
The field should have an apron to appropriately see all out-of-bounds features. This is typically the same color as the field itself, but will be created separately so as to allow for more customized plotting
Description
The field should have an apron to appropriately see all out-of-bounds features. This is typically the same color as the field itself, but will be created separately so as to allow for more customized plotting
Usage
football_field_apron(
field_length = 0,
field_width = 0,
endzone_length = 0,
boundary_thickness = 0,
field_border_thickness = 0,
restricted_area_length = 0,
restricted_area_width = 0,
coaching_box_length = 0,
coaching_box_width = 0,
team_bench_length_field_side = 0,
team_bench_length_back_side = 0,
team_bench_width = 0,
team_bench_area_border_thickness = 0,
extra_apron_padding = 0,
bench_shape = ""
)
Arguments
field_length |
The length of the field |
field_width |
The width of the field |
endzone_length |
The length of the endzone |
boundary_thickness |
The thickness of the field boundary |
field_border_thickness |
The thickness of the field border |
restricted_area_length |
The length of the restricted area |
restricted_area_width |
The width of the restricted area |
coaching_box_length |
The length of the coaching box |
coaching_box_width |
The width of the coaching box |
team_bench_length_field_side |
The length of the team bench area nearest the field |
team_bench_length_back_side |
The length of the team bench area furthest from the field |
team_bench_width |
The width of the team bench area |
team_bench_area_border_thickness |
The thickness of the border around the team bench area |
extra_apron_padding |
Any additional distance to add to the apron of the field |
bench_shape |
A string of the shape of the bench. Currently, this checks
for |
Value
A data frame of the bounding coordinates of the field apron
The field border is the border line around the outer edge of the sideline and end line. They may not be present on every field, but this is not the same as the sideline or end line (although they may be the same color)
Description
The field border is the border line around the outer edge of the sideline and end line. They may not be present on every field, but this is not the same as the sideline or end line (although they may be the same color)
Usage
football_field_border(
field_length = 0,
field_width = 0,
feature_thickness = 0,
endzone_length = 0,
boundary_line_thickness = 0,
restricted_area_length = 0,
restricted_area_width = 0,
coaching_box_length = 0,
coaching_box_width = 0,
team_bench_length_field_side = 0,
team_bench_length_back_side = 0,
team_bench_width = 0,
team_bench_area_border_thickness = 0,
surrounds_team_bench_area = FALSE,
bench_shape = ""
)
Arguments
field_length |
The length of the field |
field_width |
The width of the field |
feature_thickness |
The thickness of the field border |
endzone_length |
The length of the endzone |
boundary_line_thickness |
The thickness of the boundary lines |
restricted_area_length |
The length of the restricted area |
restricted_area_width |
The width of the restricted area |
coaching_box_length |
The length of the coaching box |
coaching_box_width |
The width of the coaching box |
team_bench_length_field_side |
The length of the side of the team bench closest to the field |
team_bench_length_back_side |
The length of the side of the team bench furthest from the field |
team_bench_width |
The width of the team bench |
team_bench_area_border_thickness |
The thickness of the border around the team bench |
surrounds_team_bench_area |
A boolean of whether or not the field border should surround the team bench |
bench_shape |
A string of the shape of the bench. Currently, this checks
for |
Value
A data frame of the bounding box of the field border
The field border's outline is the outline around the outer edge of the field border. They may not be present on every field, but this is not the same as the sideline or end line (although they may be the same color)
Description
The field border's outline is the outline around the outer edge of the field border. They may not be present on every field, but this is not the same as the sideline or end line (although they may be the same color)
Usage
football_field_border_outline(
field_length = 0,
field_width = 0,
feature_thickness = 0,
endzone_length = 0,
boundary_line_thickness = 0,
restricted_area_length = 0,
restricted_area_width = 0,
coaching_box_length = 0,
coaching_box_width = 0,
team_bench_length_field_side = 0,
team_bench_length_back_side = 0,
team_bench_width = 0,
team_bench_area_border_thickness = 0,
field_border_thickness = 0,
surrounds_team_bench_area = TRUE,
bench_shape = ""
)
Arguments
field_length |
The length of the field |
field_width |
The width of the field |
feature_thickness |
The thickness of the field border's outline |
endzone_length |
The length of the endzone |
boundary_line_thickness |
The thickness of the boundary lines |
restricted_area_length |
The length of the restricted area |
restricted_area_width |
The width of the restricted area |
coaching_box_length |
The length of the coaching box |
coaching_box_width |
The width of the coaching box |
team_bench_length_field_side |
The length of the side of the team bench closest to the field |
team_bench_length_back_side |
The length of the side of the team bench furthest from the field |
team_bench_width |
The width of the team bench |
team_bench_area_border_thickness |
The thickness of the border around the team bench |
field_border_thickness |
The thickness of the field border |
surrounds_team_bench_area |
A boolean of whether or not the field border should surround the team bench |
bench_shape |
A string of the shape of the bench. Currently, this checks
for |
Value
A data frame of the bounding box of the field border's outline
The goal lines are the lines the ball must cross while being either passed or ran in order to score a touchdown. The interior edge of the goal line (relative to the center of the field of play) should lie at the 0 yard line, and the center of the 1 yard line should be exactly 1 yard from this edge of the goal line
Description
The goal lines are the lines the ball must cross while being either passed or ran in order to score a touchdown. The interior edge of the goal line (relative to the center of the field of play) should lie at the 0 yard line, and the center of the 1 yard line should be exactly 1 yard from this edge of the goal line
Usage
football_goal_line(field_width = 0, feature_thickness = 0)
Arguments
field_width |
The width of the field |
feature_thickness |
The thickness of the goal line |
Value
A data frame of the bounding box of the goal line
Each half of the football field spans from the edge of the goal line nearest to midfield to the center of the major yard line at midfield
Description
Each half of the football field spans from the edge of the goal line nearest to midfield to the center of the major yard line at midfield
Usage
football_half_field(field_length = 0, field_width = 0)
Arguments
field_length |
The length of the field |
field_width |
The width of the field |
Value
A data frame of the bounding box of half a football field
The major yard lines are the yard lines that span the entire width of the field. Typically, these lines are placed every 5 yards, but the customization is left to the user. These lines may feature a cross-hash, which runs in the x-direction
Description
The major yard lines are the yard lines that span the entire width of the field. Typically, these lines are placed every 5 yards, but the customization is left to the user. These lines may feature a cross-hash, which runs in the x-direction
Usage
football_major_yard_line(
field_width = 0,
feature_thickness = 0,
dist_to_sideline = 0,
cross_hash_length = 0,
cross_hash_separation = 0
)
Arguments
field_width |
The width of the field |
feature_thickness |
The thickness of each of the major yard lines |
dist_to_sideline |
The distance from the end of the yard line to the interior edge of the sideline |
cross_hash_length |
The length of each cross-hash mark |
cross_hash_separation |
The interior separation between the cross-hashes |
Value
A data frame containing the bounding box of the major yard lines
The minor yard lines are the yard lines in between all of the major yard lines. Typically, there are four sets of minor yard lines: one near each sideline, and two near the middle of the field
Description
The minor yard lines are the yard lines in between all of the major yard lines. Typically, there are four sets of minor yard lines: one near each sideline, and two near the middle of the field
Usage
football_minor_yard_line(yard_line_height = 0, feature_thickness = 0)
Arguments
yard_line_height |
The height (in the y-direction) of each yard line |
feature_thickness |
The thickness of each minor yard line |
Value
A data frame of the bounding box of a minor yard line
The field border (see football_field_border()
) may have a different color
along the red zone than it does along the rest of the field. This is not
always the case, but the feature is provided for convenience
Description
The field border (see football_field_border()
) may have a different color
along the red zone than it does along the rest of the field. This is not
always the case, but the feature is provided for convenience
Usage
football_red_zone_border(feature_thickness = 0)
Arguments
feature_thickness |
The thickness of the field border |
Value
A data frame of the bounding box of the red zone border
The outline of the football_red_zone_border()
may be a different color than
the rest of the field border. This is not always the case, but the feature is
provided for convenience
Description
The outline of the football_red_zone_border()
may be a different color than
the rest of the field border. This is not always the case, but the feature is
provided for convenience
Usage
football_red_zone_border_outline(feature_thickness = 0)
Arguments
feature_thickness |
The thickness of the field border's outline |
Value
A data frame of the bounding box of the red zone border's outline
The restricted area is the area nearest the sideline's exterior edge. This area is distinct from the coaching box (immediately behind the restricted area) and team bench area
Description
The restricted area is the area nearest the sideline's exterior edge. This area is distinct from the coaching box (immediately behind the restricted area) and team bench area
Usage
football_restricted_area(restricted_area_length = 0, feature_thickness = 0)
Arguments
restricted_area_length |
The length of the restricted area |
feature_thickness |
The depth beyond the exterior edge of the sideline that the restricted area protrudes |
Value
A data frame of the bounding coordinates of the restricted area
The sidelines are the lines that run the length of the field, stretching from the back of one endzone to the back of the other endzone. Its interior edge is considered out of bounds
Description
The sidelines are the lines that run the length of the field, stretching from the back of one endzone to the back of the other endzone. Its interior edge is considered out of bounds
Usage
football_sideline(feature_thickness = 0, field_length = 0, endzone_length = 0)
Arguments
feature_thickness |
The thickness of the boundary lines |
field_length |
The length of the field |
endzone_length |
The length of the endzone |
Value
A data frame of the bounding box of the sidelines
The team bench area is the area beyond the restricted area and coaching box. It is where the team benches, non-playing players, and team staff are to remain during the game
Description
The team bench area is the area beyond the restricted area and coaching box. It is where the team benches, non-playing players, and team staff are to remain during the game
Usage
football_team_bench_area(
team_bench_length_field_side = 0,
team_bench_length_back_side = 0,
team_bench_width = 0
)
Arguments
team_bench_length_field_side |
The length of the side of the team bench area closest to the field |
team_bench_length_back_side |
The length of the side of the team bench area furthest from the field |
team_bench_width |
The depth beyond the outer edge of the coaching box line that the team bench area protrudes |
Value
A data frame of the bounding coordinates of the team bench area
The outline of the team bench area runs beyond the team bench, but is inside
of any field border that may run behind the team bench area (see
football_field_border()
for more information on this feature)
Description
The outline of the team bench area runs beyond the team bench, but is inside
of any field border that may run behind the team bench area (see
football_field_border()
for more information on this feature)
Usage
football_team_bench_area_outline(
restricted_area_length = 0,
restricted_area_width = 0,
coaching_box_length = 0,
coaching_box_width = 0,
team_bench_length_field_side = 0,
team_bench_length_back_side = 0,
team_bench_width = 0,
feature_thickness = 0
)
Arguments
restricted_area_length |
The length of the restricted area |
restricted_area_width |
The width of the restricted area |
coaching_box_length |
The length of the coaching box |
coaching_box_width |
The width of the coaching box |
team_bench_length_field_side |
The length of the side of the team bench closest to the field |
team_bench_length_back_side |
The length of the side of the team bench furthest from the field |
team_bench_width |
The width of the team bench |
feature_thickness |
The thickness of the outline of the team bench area |
Value
A data frame containing the bounding coordinates of the team bench area's outline
The try mark is the mark from which all tries start. This line is located
directly on the line y = 0
. This line is not typically considered an
official yard line, which is why it is created independently
Description
The try mark is the mark from which all tries start. This line is located
directly on the line y = 0
. This line is not typically considered an
official yard line, which is why it is created independently
Usage
football_try_mark(try_mark_width = 0, feature_thickness = 0)
Arguments
try_mark_width |
The width (in the y-direction) of the try mark |
feature_thickness |
The thickness of the try mark |
Value
A data frame of the bounding box of the try mark
Generate a ggplot2
instance containing a baseball field for a
specified league
Description
Generate a ggplot2
instance containing a baseball field for a
specified league
Usage
geom_baseball(
league,
display_range = "full",
field_updates = list(),
color_updates = list(),
rotation = 0,
x_trans = 0,
y_trans = 0,
field_units = NULL,
xlims = NULL,
ylims = NULL
)
Arguments
league |
The league for which to draw the surface. This is case-insensitive |
display_range |
A case-insensitive string indicating the display range
to use for the plot. The default is The possible display ranges are:
|
field_updates |
A list of updates to the field's parameters. These will overwrite the parameters of the league |
color_updates |
A list of updates to the field's default colors, which
are set by |
rotation |
An angle, given in degrees, through which the plot should be rotated |
x_trans |
The amount that the |
y_trans |
The amount that the |
field_units |
The units with which to draw the field. The default is
|
xlims |
The limits on the final display in the |
ylims |
The limits on the final display in the |
Value
A ggplot2
instance with a full-surface representation of a
baseball field
Examples
## Not run:
geom_baseball(league = "MLB", rotation = 270, display_range = "infield")
geom_baseball(league = "little league", field_units = "m")
## End(Not run)
Generate a ggplot2
instance containing a basketball court for a
specified league
Description
Generate a ggplot2
instance containing a basketball court for a
specified league
Usage
geom_basketball(
league,
display_range = "full",
court_updates = list(),
color_updates = list(),
rotation = 0,
x_trans = 0,
y_trans = 0,
court_units = NULL,
xlims = NULL,
ylims = NULL
)
Arguments
league |
The league for which to draw the surface. This is case-insensitive |
display_range |
A case-insensitive string indicating the display range
to use for the plot. The default is The possible display ranges are:
|
court_updates |
A list of updates to the courts' parameters. These will overwrite the parameters of the league |
color_updates |
A list of updates to the courts' default colors, which
are set by |
rotation |
An angle, given in degrees, through which the plot should be rotated |
x_trans |
The amount that the |
y_trans |
The amount that the |
court_units |
The units with which to draw the court. The default is
|
xlims |
The limits on the final display in the |
ylims |
The limits on the final display in the |
Value
A ggplot2
instance with a full-surface representation of a
basketball court
Examples
## Not run:
geom_basketball(league = "NBA", rotation = 270, display_range = "offense")
geom_basketball(league = "fiba", court_units = "ft")
## End(Not run)
Generate a ggplot2
instance containing a curling sheet for a specified
league
Description
Generate a ggplot2
instance containing a curling sheet for a specified
league
Usage
geom_curling(
league,
display_range = "full",
sheet_updates = list(),
color_updates = list(),
rotation = 0,
x_trans = 0,
y_trans = 0,
sheet_units = NULL,
xlims = NULL,
ylims = NULL
)
Arguments
league |
The league for which to draw the surface. This is case-insensitive |
display_range |
A case-insensitive string indicating the display range
to use for the plot. The default is The possible display ranges are:
|
sheet_updates |
A list of updates to the sheet's parameters. These will overwrite the parameters of the league |
color_updates |
A list of updates to the sheet's default colors, which
are set by |
rotation |
An angle, given in degrees, through which the plot should be rotated |
x_trans |
The amount that the |
y_trans |
The amount that the |
sheet_units |
The units with which to draw the sheet. The default is
|
xlims |
The limits on the final display in the |
ylims |
The limits on the final display in the |
Value
A ggplot2
instance with a full-surface representation of a
curling sheet
Examples
## Not run:
geom_curling(league = "wcf", rotation = 270, display_range = "house")
geom_curling(league = "wcf", sheet_units = "ft")
## End(Not run)
Generate a ggplot2
instance containing a football field for a
specified league
Description
Generate a ggplot2
instance containing a football field for a
specified league
Usage
geom_football(
league,
display_range = "full",
field_updates = list(),
color_updates = list(),
rotation = 0,
x_trans = 0,
y_trans = 0,
field_units = NULL,
xlims = NULL,
ylims = NULL
)
Arguments
league |
The league for which to draw the surface. This is case-insensitive |
display_range |
A case-insensitive string indicating the display range
to use for the plot. The default is The possible display ranges are:
|
field_updates |
A list of updates to the field's parameters. These will overwrite the parameters of the league |
color_updates |
A list of updates to the field's default colors, which
are set by |
rotation |
An angle, given in degrees, through which the plot should be rotated |
x_trans |
The amount that the |
y_trans |
The amount that the |
field_units |
The units with which to draw the field. The default is
|
xlims |
The limits on the final display in the |
ylims |
The limits on the final display in the |
Value
A ggplot2
instance with a full-surface representation of a
football field
Examples
## Not run:
geom_football(league = "NFL", rotation = 270, display_range = "red_zone")
geom_football(league = "cfl", field_units = "ft")
## End(Not run)
Generate a ggplot2
instance containing an ice rink for a specified
league
Description
Generate a ggplot2
instance containing an ice rink for a specified
league
Usage
geom_hockey(
league,
display_range = "full",
rink_updates = list(),
color_updates = list(),
rotation = 0,
x_trans = 0,
y_trans = 0,
rink_units = NULL,
xlims = NULL,
ylims = NULL
)
Arguments
league |
The league for which to draw the surface. This is case-insensitive |
display_range |
A case-insensitive string indicating the display range
to use for the plot. The default is The possible display ranges are:
|
rink_updates |
A list of updates to the rink's parameters. These will overwrite the parameters of the league |
color_updates |
A list of updates to the courts' default colors, which
are set by |
rotation |
An angle, given in degrees, through which the plot should be rotated |
x_trans |
The amount that the |
y_trans |
The amount that the |
rink_units |
The units with which to draw the rink. The default is
|
xlims |
The limits on the final display in the |
ylims |
The limits on the final display in the |
Value
A ggplot2
instance with a full-surface representation of an
ice hockey rink
Examples
## Not run:
geom_hockey(league = "NHL", rotation = 270, display_range = "ozone")
geom_hockey(league = "iihf", rink_units = "ft")
## End(Not run)
Generate a ggplot2
instance containing a lacrosse field for a
specified league
Description
Generate a ggplot2
instance containing a lacrosse field for a
specified league
Usage
geom_lacrosse(
league,
display_range = "full",
field_updates = list(),
color_updates = list(),
rotation = 0,
x_trans = 0,
y_trans = 0,
field_units = NULL,
xlims = NULL,
ylims = NULL
)
Arguments
league |
The league for which to draw the surface. This is case-insensitive |
display_range |
A case-insensitive string indicating the display range
to use for the plot. The default is The possible display ranges are:
|
field_updates |
A list of updates to the fields' parameters. These will overwrite the parameters of the league |
color_updates |
A list of updates to the fields' default colors, which
are set by |
rotation |
An angle, given in degrees, through which the plot should be rotated |
x_trans |
The amount that the |
y_trans |
The amount that the |
field_units |
The units with which to draw the field. The default is
|
xlims |
The limits on the final display in the |
ylims |
The limits on the final display in the |
Value
A ggplot2
instance with a full-surface representation of a
lacrosse field
Examples
## Not run:
geom_lacrosse(league = "NCAA", rotation = 270, display_range = "offense")
geom_lacrosse(league = "FIVB", field_units = "ft")
## End(Not run)
Generate a ggplot2
instance containing a soccer pitch for a specified
league
Description
Generate a ggplot2
instance containing a soccer pitch for a specified
league
Usage
geom_soccer(
league,
display_range = "full",
pitch_updates = list(),
color_updates = list(),
rotation = 0,
x_trans = 0,
y_trans = 0,
pitch_units = NULL,
xlims = NULL,
ylims = NULL
)
Arguments
league |
The league for which to draw the surface. This is case-insensitive |
display_range |
A case-insensitive string indicating the display range
to use for the plot. The default is The possible display ranges are:
|
pitch_updates |
A list of updates to the pitch's parameters. These will overwrite the parameters of the league |
color_updates |
A list of updates to the pitch's default colors, which
are set by |
rotation |
An angle, given in degrees, through which the plot should be rotated |
x_trans |
The amount that the |
y_trans |
The amount that the |
pitch_units |
The units with which to draw the pitch. The default is
|
xlims |
The limits on the final display in the |
ylims |
The limits on the final display in the |
Value
A ggplot2
instance with a full-surface representation of a
soccer pitch
Examples
## Not run:
geom_soccer(league = "EPL", rotation = 270, display_range = "offense")
geom_soccer(league = "fifa", pitch_units = "ft")
## End(Not run)
Generate a ggplot2
instance containing a tennis court for a specified
league
Description
Generate a ggplot2
instance containing a tennis court for a specified
league
Usage
geom_tennis(
league,
display_range = "full",
court_updates = list(),
color_updates = list(),
rotation = 0,
x_trans = 0,
y_trans = 0,
court_units = NULL,
xlims = NULL,
ylims = NULL
)
Arguments
league |
The league for which to draw the surface. This is case-insensitive |
display_range |
A case-insensitive string indicating the display range
to use for the plot. The default is The possible display ranges are:
|
court_updates |
A list of updates to the courts' parameters. These will overwrite the parameters of the league |
color_updates |
A list of updates to the courts' default colors, which
are set by |
rotation |
An angle, given in degrees, through which the plot should be rotated |
x_trans |
The amount that the |
y_trans |
The amount that the |
court_units |
The units with which to draw the court. The default is
|
xlims |
The limits on the final display in the |
ylims |
The limits on the final display in the |
Value
A ggplot2
instance with a full-surface representation of a
tennis court
Examples
## Not run:
geom_tennis(league = "USTA", rotation = 270, display_range = "serving")
geom_tennis(league = "itf", court_units = "m")
## End(Not run)
Generate a ggplot2
instance containing a volleyball court for a
specified league
Description
Generate a ggplot2
instance containing a volleyball court for a
specified league
Usage
geom_volleyball(
league,
display_range = "full",
court_updates = list(),
color_updates = list(),
rotation = 0,
x_trans = 0,
y_trans = 0,
court_units = NULL,
xlims = NULL,
ylims = NULL
)
Arguments
league |
The league for which to draw the surface. This is case-insensitive |
display_range |
A case-insensitive string indicating the display range
to use for the plot. The default is The possible display ranges are:
|
court_updates |
A list of updates to the courts' parameters. These will overwrite the parameters of the league |
color_updates |
A list of updates to the courts' default colors, which
are set by |
rotation |
An angle, given in degrees, through which the plot should be rotated |
x_trans |
The amount that the |
y_trans |
The amount that the |
court_units |
The units with which to draw the court. The default is
|
xlims |
The limits on the final display in the |
ylims |
The limits on the final display in the |
Value
A ggplot2
instance with a full-surface representation of a
volleyball court
Examples
## Not run:
geom_volleyball(league = "NCAA", rotation = 270, display_range = "offense")
geom_volleyball(league = "FIVB", court_units = "ft")
## End(Not run)
The boards are the wall around the outside of the rink that constrain the playing surface. The boards are typically ovular in shape
Description
The boards are the wall around the outside of the rink that constrain the playing surface. The boards are typically ovular in shape
Usage
hockey_boards(
rink_length = 0,
rink_width = 0,
feature_radius = 0,
feature_thickness = 0
)
Arguments
rink_length |
The length of the rink |
rink_width |
The width of the rink |
feature_radius |
The radius of the corners of the boards |
feature_thickness |
The thickness with which to draw the boards |
Value
A data frame of the bounding coordinates of the boards
The center faceoff circle is where the each period of the game begins. It differs from the non-centered faceoff circles in that there are no adjoining hash marks on this circle. It is also a different color than the non-centered faceoff circles. Its line thickness should be given by 'minor_line_thickness' as this is a minor line on the ice surface
Description
This draws the line defining the faceoff circle at center ice. The line is circular in shape, and usually dark blue in color
Usage
hockey_center_faceoff_circle(feature_radius = 0, feature_thickness = 0)
Arguments
feature_radius |
The radius of the center faceoff circle |
feature_thickness |
The thickness of the line of the center faceoff circle |
Value
A data frame containing the bounding coordinates of the center faceoff circle
The center faceoff spot is the spot at which the game begins. Its center
should lie directly in the center of the ice surface. Its radius is passed as
a key in rink_params
Description
The center faceoff spot is the spot at which the game begins. Its center
should lie directly in the center of the ice surface. Its radius is passed as
a key in rink_params
Usage
hockey_center_faceoff_spot(feature_radius = 0)
Arguments
feature_radius |
The radius of the center faceoff spot |
Value
A data frame containing the bounding coordinates of the center faceoff spot
The center line is the line that divides the ice surface in half. Its center should lie directly in the center of the ice surface. Its line thickness should be given by 'major_line_thickness' as this is a major line on the ice surface
Description
The center line is the line that divides the ice surface in half. Its center should lie directly in the center of the ice surface. Its line thickness should be given by 'major_line_thickness' as this is a major line on the ice surface
Usage
hockey_center_line(
feature_thickness = 0,
rink_width = 0,
center_faceoff_spot_gap = 0
)
Arguments
feature_thickness |
The thickness of the center line |
rink_width |
The width of the rink |
Value
A data frame of the bounding coordinates of the center line
The defensive zone is the left "third" of the rink in TV view. This is the area that a team defends when attacking from left to right
Description
The defensive zone is the left "third" of the rink in TV view. This is the area that a team defends when attacking from left to right
Usage
hockey_defensive_zone(
rink_length = 0,
rink_width = 0,
feature_radius = 0,
nzone_length = 0
)
Arguments
rink_length |
The length of the rink |
rink_width |
The width of the rink |
feature_radius |
The radius of the corners of the boards |
nzone_length |
The length of the neutral zone |
Value
A data frame of the bounding coordinates of the defensive zone
Set the colors to be used for the plot. The values provided in the arguments are the defaults, and, where specified, are the rule-book specified values.
Description
Hexadecimal values are the passed vales to this function by default, but it
is also possible to use string-named values (e.g. "dodgerblue"
) when
specifying.
Usage
hockey_features_set_colors(
plot_background = NULL,
boards = "#000000",
ozone_ice = "#ffffff",
nzone_ice = "#ffffff",
dzone_ice = "#ffffff",
center_line = "#c8102e",
zone_line = "#0033a0",
goal_line = "#c8102e",
restricted_trapezoid = "#c8102e",
goal_crease_outline = "#c8102e",
goal_crease_fill = "#41b6e6",
referee_crease = "#c8102e",
center_faceoff_spot = "#0033a0",
faceoff_spot_ring = "#c8102e",
faceoff_spot_stripe = "#c8102e",
center_faceoff_circle = "#0033a0",
odzone_faceoff_circle = "#c8102e",
faceoff_line = "#c8102e",
goal_frame = "#c8102e",
goal_fill = "#a5acaf4d",
team_a_bench = "#ffffff",
team_b_bench = "#ffffff",
team_a_penalty_box = "#ffffff",
team_b_penalty_box = "#ffffff",
off_ice_officials_box = "#a5acaf"
)
Arguments
plot_background |
A hexadecimal string representing the color to use for this feature |
boards |
A hexadecimal string representing the color to use for this feature |
ozone_ice |
A hexadecimal string representing the color to use for this feature |
nzone_ice |
A hexadecimal string representing the color to use for this feature |
dzone_ice |
A hexadecimal string representing the color to use for this feature |
center_line |
A hexadecimal string representing the color to use for this feature |
zone_line |
A hexadecimal string representing the color to use for this feature |
goal_line |
A hexadecimal string representing the color to use for this feature |
restricted_trapezoid |
A hexadecimal string representing the color to use for this feature |
goal_crease_outline |
A hexadecimal string representing the color to use for this feature |
goal_crease_fill |
A hexadecimal string representing the color to use for this feature |
referee_crease |
A hexadecimal string representing the color to use for this feature |
center_faceoff_spot |
A hexadecimal string representing the color to use for this feature |
faceoff_spot_ring |
A hexadecimal string representing the color to use for this feature |
faceoff_spot_stripe |
A hexadecimal string representing the color to use for this feature |
center_faceoff_circle |
A hexadecimal string representing the color to use for this feature |
odzone_faceoff_circle |
A hexadecimal string representing the color to use for this feature |
faceoff_line |
A hexadecimal string representing the color to use for this feature |
goal_frame |
A hexadecimal string representing the color to use for this feature |
goal_fill |
A hexadecimal string representing the color to use for this feature |
team_a_bench |
A hexadecimal string representing the color to use for this feature |
team_b_bench |
A hexadecimal string representing the color to use for this feature |
team_a_penalty_box |
A hexadecimal string representing the color to use for this feature |
team_b_penalty_box |
A hexadecimal string representing the color to use for this feature |
off_ice_officials_box |
A hexadecimal string representing the color to use for this feature |
Value
A list of hexadecimal colors to use to color the features on the resulting plot
The goal crease is the area where a goaltender plays their position. It is
comprised of two components: the outline of the crease (see
hockey_goal_crease_outline()
), and the filling in its boundary. The goal
crease may have two notches (one on each side of the line y = 0)
Description
The filling of the goal crease should have thickness given by 'minor_line_thickness', as this refers to the crease's outline, which is a minor line on the ice surface. The goal crease's filling is usually light in color
Usage
hockey_goal_crease_fill(
feature_radius = 0,
feature_thickness = 0,
crease_style = "",
crease_length = 0,
crease_width = 0,
notch_dist_x = 0,
notch_width = 0
)
Arguments
feature_radius |
The radius of the goal crease |
feature_thickness |
The thickness of the line marking the outline of the goal crease |
crease_style |
The style of the goal crease |
crease_length |
The length of the goal crease |
crease_width |
The width of the goal crease |
notch_dist_x |
The distance from the back edge of the goal line to the further edge of the crease notch |
notch_width |
The width of the notch in the goal crease |
Value
A data frame containing the bounding coordinates of the goal crease's inner filling
The goal crease is the area where a goaltender plays their position. It is
comprised of two components: the outline of the crease, and the filling in
its boundary (see hockey_goal_crease_fill()
). The goal crease may have two
notches (one on each side of the line y = 0)
Description
The outline of the goal crease should have thickness given by 'minor_line_thickness', as this is a minor line on the ice surface, and the outline is usually red in color
Usage
hockey_goal_crease_outline(
feature_radius = 0,
feature_thickness = 0,
crease_style = "",
crease_length = 0,
crease_width = 0,
notch_dist_x = 0,
notch_width = 0
)
Arguments
feature_radius |
The radius of the goal crease |
feature_thickness |
The thickness of the line marking the outline of the goal crease |
crease_style |
The style of the goal crease |
crease_length |
The length of the goal crease |
crease_width |
The width of the goal crease |
notch_dist_x |
The distance from the back edge of the goal line to the further edge of the crease notch |
notch_width |
The width of the notch in the goal crease |
Value
A data frame containing the bounding coordinates of the goal crease's outline
The goal frame is where the puck enters after crossing the goal line to score
a legal goal. The front face of the goal is flush with the goal line, while
the back edge features rounded corners and expands outside of the front
posts. The goal frame is composed of two pieces: the frame (this method) and
the fill (see hockey_goal_frame_fill()
)
Description
The goal frame has two thicknesses to be careful of: the outer diameter of the posts, and the outer diameter of the pipe in the back of the goal. The frame of the goal is usually red in color
Usage
hockey_goal_frame(
feature_radius = 0,
goal_mouth_width = 0,
goal_back_width = 0,
goal_depth = 0,
goal_post_diameter = 0
)
Arguments
feature_radius |
The radius of the circular part of the goal frame |
goal_mouth_width |
The width of the goal mouth |
goal_back_width |
The width of the back of the frame of the goal |
goal_depth |
The depth of the goal from the front of the goal line to the back of the goal frame |
goal_post_diameter |
The diameter of the post of the goal |
Value
A data frame containing the bounding coordinates of the frame of the goal
The goal frame is where the puck enters after crossing the goal line to score
a legal goal. The front face of the goal is flush with the goal line, while
the back edge features rounded corners and expands outside of the front
posts. The goal frame is composed of two pieces: the frame (see
hockey_goal_frame()
) and the fill (this function)
Description
The goal frame has two thicknesses to be careful of: the outer diameter of the posts, and the outer diameter of the pipe in the back of the goal. The frame of the goal is usually red in color
Usage
hockey_goal_frame_fill(
feature_radius = 0,
goal_mouth_width = 0,
goal_back_width = 0,
goal_depth = 0,
goal_post_diameter = 0
)
Arguments
feature_radius |
The radius of the circular part of the goal frame |
goal_mouth_width |
The width of the goal mouth |
goal_back_width |
The width of the back of the frame of the goal |
goal_depth |
The depth of the goal from the front of the goal line to the back of the goal frame |
goal_post_diameter |
The diameter of the post of the goal |
Value
A data frame containing the bounding coordinates of the frame of the goal
The goal lines are the lines over which a puck must cross (within the goal frame) in order to be considered a goal. Its line thickness should be given by 'minor_line_thickness' as this is a minor line on the ice surface.
Description
This draws the right-side goal line (in TV view), starting with its left edge. This also accounts for a perfectly rectangular goal line if a user supplies a value that necessitates one. The line is rectangular in shape with rounded ends, and usually red in color
Usage
hockey_goal_line(
rink_length = 0,
rink_width = 0,
feature_radius = 0,
feature_thickness = 0,
x_anchor = 0
)
Arguments
rink_length |
The length of the rink |
rink_width |
The width of the rink |
feature_radius |
The radius of the corner of the rink |
feature_thickness |
The thickness of the goal line |
x_anchor |
the |
Value
A data frame containing the bounding coordinates of the goal line
The goaltender's restricted area marks where a goaltender is legally allowed to handle the puck behind the net. This is often referred to as "the trapezoid" as it is trapezoidal in shape. Its line thickness should be given by 'minor_line_thickness' as this is a minor line on the ice surface
Description
NOTE: This is not a requirement in all leagues, and may be omitted via the
"has_trapezoid" key in the rink_params
passed to geom_{league}
Usage
hockey_goaltenders_restricted_area(
rink_length = 0,
feature_thickness = 0,
short_base_width = 0,
long_base_width = 0,
x_anchor = 0
)
Arguments
rink_length |
The length of the rink |
feature_thickness |
The thickness of the lines used to draw the goaltender's restricted area |
short_base_width |
The width of the base nearest the center line |
long_base_width |
The width of the base nearest the boards behind the goal |
x_anchor |
the |
Details
This draws the goaltender's restricted area on the right side (in TV view) of the ice surface. The figure is composed of lines that outline a trapezoid in shape, and is usually red in color
Value
A data frame containing the bounding coordinates of the goaltender's restricted area
The neutral zone is the middle "third" of the rink. This is the area between the two zone (blue) lines. The center of the neutral zone should lie along the line x = 0
Description
The neutral zone is the middle "third" of the rink. This is the area between the two zone (blue) lines. The center of the neutral zone should lie along the line x = 0
Usage
hockey_neutral_zone(rink_width = 0, feature_thickness = 0)
Arguments
rink_width |
The width of the rink |
feature_thickness |
The length of the neutral zone |
Value
A data frame containing the bounding coordinates of the neutral zone
The non-centered faceoff spots are located in the neutral, offensive and defensive zones of the ice, with one on each side of the x-axis when viewing the rink in TV view. These spots differ from the center faceoff spot because they have a larger diameter, differ in color, and have a colored stripe that runs through its center.
Description
This function is responsible for creating the outer ring, not the colored
stripe running through it. Please see hockey_nodzone_faceoff_spot_stripe()
for more information on it
Usage
hockey_nodzone_faceoff_spot_ring(feature_radius = 0, feature_thickness = 0)
Arguments
feature_radius |
The outer radius of the non-centered faceoff spot ring |
feature_thickness |
The thickness of the non-centered faceoff spot ring |
Details
The non-centered faceoff spots are where faceoffs are taken after an icing call or to start a powerplay. They differ from the center ice faceoff spot in size, color, and form. The thickness should be given by 'minor_line_thickness' as these are minor lines on the ice surface
Value
A data frame containing the bounding coordinates of a non-centered faceoff spot ring
The non-centered faceoff spots are located in the neutral, offensive and defensive zones of the ice, with one on each side of the x-axis when viewing the rink in TV view. These spots differ from the center faceoff spot because they have a larger diameter, differ in color, and have a colored stripe that runs through its center.
Description
This function is responsible for creating the inner stripe, not the colored
outer ring around it. Please see hockey_nodzone_faceoff_spot_ring()
for
more information on it
Usage
hockey_nodzone_faceoff_spot_stripe(
feature_radius = 0,
feature_thickness = 0,
gap_width = 0
)
Arguments
feature_radius |
The outer radius of the non-centered faceoff spot |
feature_thickness |
The thickness of the non-centered faceoff spot ring |
gap_width |
The width of the gap from the inner edge of the non-centered faceoff spot ring to the outer edge of the stripe |
Details
The non-centered faceoff spots are where faceoffs are taken after an icing call or to start a powerplay. They differ from the center ice faceoff spot in size, color, and form. For the faceoff spot's stripe, the 'feature_thickness' parameter should be the thickness of the outer ring, which is 'minor_line_thickness'
Value
A data frame containing the bounding coordinates of the non-centered faceoff spot's stripe
The non-centered faceoff circles are located in the offensive and defensive zones of the ice, with one on each side of the x-axis when viewing the rink in TV view. These circles differ from the center faceoff circle because they have hash marks that extend towards the boards on each side of the circle
Description
The non-centered faceoff circles are where faceoffs are taken after an icing call or to start a powerplay. They differ from the center ice faceoff circle because there are adjoining hash marks on these circles. It is also a different color than the center ice faceoff circle, and the spot in the center of it varies in size and form. Its line thickness should be given by 'minor_line_thickness' as this is a minor line on the ice surface
Usage
hockey_odzone_faceoff_circle(
feature_radius = 0,
feature_thickness = 0,
hashmark_width = 0,
hashmark_ext_spacing = 0
)
Arguments
feature_radius |
The radius of the faceoff circle |
feature_thickness |
The thickness of the line of the non-centered faceoff circle |
hashmark_width |
The width of the hashmarks on the exterior of the non-centered faceoff circle |
hashmark_ext_spacing |
The external spacing between the hashmarks' outer edges |
Value
A data frame containing the bounding coordinates of the non-centered faceoff circle
The offensive/defensive zone faceoff lines are the L-shaped lines where players on each team line up when taking a faceoff in either the offensive or defensive zones. There are four of these faceoff lines around each offensive/defensive faceoff spot
Description
These lines are L-shaped, but can be thought of as two rectangles with thickness given by 'minor_line_thickness', and are usually red in color
Usage
hockey_odzone_faceoff_lines(
feature_thickness = 0,
faceoff_line_dist_x = 0,
faceoff_line_dist_y = 0,
faceoff_line_length = 0,
faceoff_line_width = 0
)
Arguments
feature_thickness |
The thickness of the faceoff lines |
faceoff_line_dist_x |
The distance from the center of the faceoff spot to the interior edge of the faceoff lines in the x direction |
faceoff_line_dist_y |
The distance from the center of the faceoff spot to the interior edge of the faceoff lines in the y direction |
faceoff_line_length |
The length of the faceoff lines from the edge nearest the goal line to the edge nearest the end boards |
faceoff_line_width |
The width of the faceoff lines from the edge nearest the center of the spot to the edge nearest the side boards |
Value
A data frame containing the bounding coordinates of the offensive/defensive zone faceoff lines
The off-ice officials' box is located between the two penalty boxes, opposite the team bench areas
Description
This will have the same thickness as the boards, but will be located outside the ice surface
Usage
hockey_off_ice_officials_box(
feature_thickness = 0,
officials_box_length = 0,
officials_box_depth = 0
)
Arguments
feature_thickness |
The thickness of the outline of the off-ice officials' box |
officials_box_length |
The length of the off-ice officials' box |
officials_box_depth |
The depth at which the off-ice officials' box extends from the outer edge of the boards |
Value
A data frame containing the bounding coordinates of the off-ice officials' box's outline
The offensive zone is the right "third" of the rink in TV view. This is the area that a team attacks to try to score a goal when attacking from left to right
Description
The offensive zone is the right "third" of the rink in TV view. This is the area that a team attacks to try to score a goal when attacking from left to right
Usage
hockey_offensive_zone(
rink_length = 0,
rink_width = 0,
feature_radius = 0,
nzone_length = 0
)
Arguments
rink_length |
The length of the rink |
rink_width |
The width of the rink |
feature_radius |
The radius of the corners of the boards |
nzone_length |
The length of the neutral zone |
Value
A data frame of the bounding coordinates of the offensive zone
The penalty boxes are the areas outside the confines of the rink where
players serve time for a penalty incurred. They are to be on the same side of
the ice surface and separate, as close to center ice as possible, for each
team. This will not include the off-ice officials' box; see
hockey_off_ice_officials_box()
for more information
Description
This will have the same thickness as the boards, but will be located outside the ice surface
Usage
hockey_penalty_box_fill(
feature_thickness = 0,
penalty_box_length = 0,
penalty_box_depth = 0
)
Arguments
feature_thickness |
The thickness of the outline of the penalty box |
penalty_box_length |
The length of the penalty box |
penalty_box_depth |
The depth at which the penalty box extends from the outer edge of the boards |
Value
A data frame containing the bounding coordinates of the penalty box's inner filling
The penalty boxes are the areas outside the confines of the rink where players serve time for a penalty incurred. They are to be on the same side of the ice surface and separate, as close to center ice as possible, for each team. This will also include the off-ice officials' box
Description
This will have the same thickness as the boards, but will be located outside the ice surface. Each penalty box's outline will share the same color as the boards
Usage
hockey_penalty_box_outline(
feature_thickness = 0,
penalty_box_length = 0,
penalty_box_width = 0,
penalty_box_separation = 0,
penalty_box_depth = 0
)
Arguments
feature_thickness |
The thickness of the outline of the penalty box |
penalty_box_length |
The length of the penalty box |
penalty_box_separation |
The separation between the two penalty boxes |
penalty_box_depth |
The depth at which the penalty box extends from the outer edge of the boards |
Value
A data frame containing the bounding coordinates of the penalty box
The player benches are the areas outside the confines of the rink where players not currently on the ice are seated. They are to be on the same side of the ice surface and separate, as close to center ice as possible
Description
This will have the same thickness as the boards, but will be located outside the ice surface
Usage
hockey_player_bench_area_fill(
feature_thickness = 0,
bench_length = 0,
bench_depth = 0
)
Arguments
feature_thickness |
The thickness of the outline of the player bench area |
bench_length |
The length of the player bench area |
bench_depth |
The depth of the player bench area |
Value
A data frame containing the bounding coordinates of the player bench area's inner filling
The player benches are the areas outside the confines of the rink where players not currently on the ice are seated. They are to be on the same side of the ice surface and separate, as close to center ice as possible
Description
This will have the same thickness as the boards, but will be located outside the ice surface. Each bench's outline will share the same color as the boards
Usage
hockey_player_bench_outline(
feature_thickness = 0,
bench_length = 0,
bench_depth = 0
)
Arguments
feature_thickness |
The thickness of the outline of the player bench areas |
bench_length |
The length of the player bench area |
bench_depth |
The depth of the player bench area |
Value
A data frame containing the bounding coordinates of the player bench area
The referee's crease is a semi-circle on the "bottom" of the boards (in TV view), centered on the line y = 0 (the center of the center line)
Description
The referee's crease is a semi-circle on the "bottom" of the boards (in TV view), centered on the line y = 0 (the center of the center line)
Usage
hockey_referee_crease(feature_radius = 0, feature_thickness = 0)
Arguments
feature_radius |
The radius of the referee's crease |
feature_thickness |
The thickness with which to draw the referee's crease |
Value
A data frame of the bounding coordinates of the referee's crease
The zone lines are the lines that separate the neutral zone from the offensive and defensive zones. Its line thickness should be given by 'major_line_thickness' as this is a major line on the ice surface
Description
The zone lines are the lines that separate the neutral zone from the offensive and defensive zones. Its line thickness should be given by 'major_line_thickness' as this is a major line on the ice surface
Usage
hockey_zone_line(rink_width = 0, feature_thickness = 0)
Arguments
rink_width |
The width of the rink |
feature_thickness |
The thickness of the zone line |
Value
A data frame containing the bounding coordinates of the zone line
Identify if a passed color is a hexadecimal string
Description
Identify if a passed color is a hexadecimal string
Usage
is_hex(col_str = "")
Arguments
col_str |
The potentially-hexadecimal string to check |
Value
A boolean indicating if the string is in fact hexadecimal
On some fields, there is a below goal marking. These are circles that should mirror each other, with their center points used as anchors
Description
On some fields, there is a below goal marking. These are circles that should mirror each other, with their center points used as anchors
Usage
lacrosse_below_goal_marking(below_goal_marking_radius = 0)
Arguments
below_goal_marking_radius |
The radius of the below goal marking |
Value
A data frame containing the bounding coordinates of the below goal marking
The boards are the wall around the outside of the field that constrain the playing surface. The boards are either typically ovular in shape, or not present if the field is outdoors
Description
The boards are the wall around the outside of the field that constrain the playing surface. The boards are either typically ovular in shape, or not present if the field is outdoors
Usage
lacrosse_boards(
field_length = 0,
field_width = 0,
corner_radius = 0,
boundary_thickness = 0
)
Arguments
field_length |
The length of the field |
field_width |
The width of the field |
corner_radius |
The radius of the corners of the boards |
boundary_thickness |
The thickness with which to draw the boards |
Value
A data frame of the bounding coordinates of the boards
The center circle is where play begins to start a game. This is located at the center of the field (when present)
Description
The center circle is where play begins to start a game. This is located at the center of the field (when present)
Usage
lacrosse_center_circle(center_circle_radius = 0, center_circle_thickness = 0)
Arguments
center_circle_radius |
The outer radius of the center circle |
center_circle_thickness |
The thickness of the center circle |
Value
A data frame containing the bounding coordinates of the center circle
The center line divides the field of play into two equal halves, which are
generated via lacrosse_offensive_zone()
, lacrosse_defensive_zone()
, and
lacrosse_neutral_zone()
. This line may not stretch the entire width of the
field, so a parameter is created instead
Description
The center line divides the field of play into two equal halves, which are
generated via lacrosse_offensive_zone()
, lacrosse_defensive_zone()
, and
lacrosse_neutral_zone()
. This line may not stretch the entire width of the
field, so a parameter is created instead
Usage
lacrosse_center_line(center_line_width = 0, line_thickness = 0)
Arguments
center_line_width |
The width of the center line (distance in |
line_thickness |
The thickness of the center line |
Value
A data frame containing the bounding coordinates of the center line
The change area is the box-shaped area in front of the team benches where a
substitutions occur. This feature describes its interior fill; its outline
is controlled by lacrosse_change_area_outline()
Description
The change area is the box-shaped area in front of the team benches where a
substitutions occur. This feature describes its interior fill; its outline
is controlled by lacrosse_change_area_outline()
Usage
lacrosse_change_area_fill(change_area_length = 0, change_area_width = 0)
Arguments
change_area_length |
The length of the change area's interior |
change_area_width |
The distance off the boards that the change area extends into the playing surface |
Value
A data frame containing the bounding coordinates of the change area's interior fill
The change area is the box-shaped area in front of the team benches where a
substitutions occur. This feature describes its outline; its interior fill
is controlled by lacrosse_change_area_fill()
Description
The change area is the box-shaped area in front of the team benches where a
substitutions occur. This feature describes its outline; its interior fill
is controlled by lacrosse_change_area_fill()
Usage
lacrosse_change_area_outline(
change_area_length = 0,
change_area_width = 0,
feature_thickness = 0
)
Arguments
change_area_length |
The length of the change area's interior |
change_area_width |
The distance off the boards that the change area extends into the playing surface |
feature_thickness |
The thickness of the outline of the box |
Value
A data frame containing the bounding coordinates of the change area's outline
The defensive-area lines run parallel to the sidelines and are connected to
the end line (see lacrosse_end_line()
) and restraining line (see
lacrosse_restraining_line()
) when these features are present
Description
The defensive-area lines run parallel to the sidelines and are connected to
the end line (see lacrosse_end_line()
) and restraining line (see
lacrosse_restraining_line()
) when these features are present
Usage
lacrosse_defensive_area_line(
defensive_area_line_length = 0,
line_thickness = 0
)
Arguments
defensive_area_line_length |
The length of the defensive-area line length |
line_thickness |
The thickness of the defensive area line |
Value
A data frame containing the bounding coordinates of the defensive area lines
The defensive zone is the TV-left area of the playing surface. In many cases, this will correspond to half of the field's length
Description
The defensive zone is the TV-left area of the playing surface. In many cases, this will correspond to half of the field's length
Usage
lacrosse_defensive_zone(
field_length = 0,
field_width = 0,
corner_radius = 0,
nzone_length = 0,
field_shape = "rectangle"
)
Arguments
field_length |
The interior length of the field |
field_width |
The interior width of the field |
corner_radius |
The radius of the corner (assuming |
nzone_length |
The length of the neutral zone |
field_shape |
The shape of the field, passed as a string |
Value
A data frame containing the bounding coordinates of the defensive zone
The end lines run the width of the field, with its interior edge designating the in-bounds area
Description
The end lines run the width of the field, with its interior edge designating the in-bounds area
Usage
lacrosse_end_line(field_width = 0, line_thickness = 0)
Arguments
field_width |
The interior width of the field |
line_thickness |
The thickness of the end line |
Value
A data frame containing the bounding coordinates of the sideline
The face-off markers are where face-offs occur. They may take one of two forms: an "X" shape or a circle
Description
The face-off markers are where face-offs occur. They may take one of two forms: an "X" shape or a circle
Usage
lacrosse_face_off_marker(
shape = "O",
feature_thickness = 0,
side_length = 0,
feature_radius = 0
)
Arguments
shape |
one of the following strings (case-insensitive):
|
feature_thickness |
The thickness of a single bar of the "X" shape |
side_length |
The length of a single bar of the "X" shape |
feature_radius |
The radius of a circular face-off spot |
Value
A data frame containing the bounding coordinates of a face-off spot
Set the colors to be used for the plot. The values provided in the arguments are the defaults, and, where specified, are the rule-book specified values.
Description
Hexadecimal values are the passed vales to this function by default, but it
is also possible to use string-named values (e.g. "dodgerblue"
) when
specifying.
Usage
lacrosse_features_set_colors(
plot_background = NULL,
field_apron = "#195f0c",
defensive_zone = "#195f0c",
neutral_zone = "#195f0c",
offensive_zone = "#195f0c",
team_a_bench = "#a5acaf4d",
team_b_bench = "#a5acaf4d",
team_a_penalty_box = "#a5acaf4d",
team_b_penalty_box = "#a5acaf4d",
off_field_officials_box = "#a5acaf",
boards = "#ffa500",
end_line = "#ffffff",
sideline = "#ffffff",
center_line = "#ffffff",
wing_line = "#ffffff",
restraining_line = "#ffffff",
defensive_area_line = "#ffffff",
goal_line = "#ffffff",
referee_crease = "#ffffff",
referee_crease_fill = "#195f0c",
goal_circle = "#ffffff",
goal_circle_fill = "#195f0c",
goal_arc = "#ffffff",
goal_fan = "#ffffff",
goal_fan_hash_mark = "#ffffff",
goal_mouth_hash_mark = "#ffffff",
goal_mouth = "#ffffff",
below_goal_marking = "#ffffff",
goal_frame = "#ffa500",
goal_net = "#a5acaf4d",
center_circle = "#ffffff",
center_face_off_marker = "#ffffff",
corner_face_off_marker = "#ffffff",
change_area_outline = "#ffffff",
change_area_fill = "#195f0c"
)
Arguments
plot_background |
A hexadecimal string representing the color to use for this feature |
field_apron |
A hexadecimal string representing the color to use for this feature |
defensive_zone |
A hexadecimal string representing the color to use for this feature |
neutral_zone |
A hexadecimal string representing the color to use for this feature |
offensive_zone |
A hexadecimal string representing the color to use for this feature |
team_a_bench |
A hexadecimal string representing the color to use for this feature |
team_b_bench |
A hexadecimal string representing the color to use for this feature |
team_a_penalty_box |
A hexadecimal string representing the color to use for this feature |
team_b_penalty_box |
A hexadecimal string representing the color to use for this feature |
off_field_officials_box |
A hexadecimal string representing the color to use for this feature |
boards |
A hexadecimal string representing the color to use for this feature |
end_line |
A hexadecimal string representing the color to use for this feature |
sideline |
A hexadecimal string representing the color to use for this feature |
center_line |
A hexadecimal string representing the color to use for this feature |
wing_line |
A hexadecimal string representing the color to use for this feature |
restraining_line |
A hexadecimal string representing the color to use for this feature |
defensive_area_line |
A hexadecimal string representing the color to use for this feature |
goal_line |
A hexadecimal string representing the color to use for this feature |
referee_crease |
A hexadecimal string representing the color to use for this feature |
referee_crease_fill |
A hexadecimal string representing the color to use for this feature |
goal_circle |
A hexadecimal string representing the color to use for this feature |
goal_circle_fill |
A hexadecimal string representing the color to use for this feature |
goal_arc |
A hexadecimal string representing the color to use for this feature |
goal_fan |
A hexadecimal string representing the color to use for this feature |
goal_fan_hash_mark |
A hexadecimal string representing the color to use for this feature |
goal_mouth_hash_mark |
A hexadecimal string representing the color to use for this feature |
goal_mouth |
A hexadecimal string representing the color to use for this feature |
below_goal_marking |
A hexadecimal string representing the color to use for this feature |
goal_frame |
A hexadecimal string representing the color to use for this feature |
goal_net |
A hexadecimal string representing the color to use for this feature |
center_circle |
A hexadecimal string representing the color to use for this feature |
center_face_off_marker |
A hexadecimal string representing the color to use for this feature |
corner_face_off_marker |
A hexadecimal string representing the color to use for this feature |
change_area_outline |
A hexadecimal string representing the color to use for this feature |
change_area_fill |
A hexadecimal string representing the color to use for this feature |
Value
A list of hexadecimal colors to use to color the features on the resulting plot
Outdoor require should have a field apron so that boundary lines are more visible
Description
Outdoor require should have a field apron so that boundary lines are more visible
Usage
lacrosse_field_apron(
field_length = 0,
field_width = 0,
field_apron_thickness = 0,
field_shape = "rectangle"
)
Arguments
field_length |
The length of the field |
field_width |
The width of the field |
field_apron_thickness |
The thickness of the field apron |
field_shape |
The shape of the field, passed as a string |
Value
A data frame of the bounding coordinates of the field apron
The arc around the goal circle is a semi-circular area located around the
goal circle (see lacrosse_goal_circle()
) that may extend back to the end
line, but also may be cut off at the goal line extended. The extension should
be controlled via the goal_arc_extension
parameter. Note: the hash
marks are generated via lacrosse_goal_fan_hash_mark()
Description
The arc around the goal circle is a semi-circular area located around the
goal circle (see lacrosse_goal_circle()
) that may extend back to the end
line, but also may be cut off at the goal line extended. The extension should
be controlled via the goal_arc_extension
parameter. Note: the hash
marks are generated via lacrosse_goal_fan_hash_mark()
Usage
lacrosse_goal_arc(
goal_arc_extension = 0,
goal_arc_radius = 0,
line_thickness = 0
)
Arguments
goal_arc_extension |
The extension from the goal line towards the end line |
goal_arc_radius |
The outer radius of the goal arc, measured from the center of the goal line |
line_thickness |
The thickness of the goal arc |
Value
A data frame containing the the bounding coordinates of the goal arc
The goal circle is a circular feature on the field that houses the goal line
(see lacrosse_goal_line()
) and the goal. Notably, for fields with a
surrounding arc and/or fan around the goal area, this feature only
circumscribes the goal. Those features will be handled separately. This
feature may either be the full circle (e.g. all 360 degrees), or a partial
circle that may be greater than a half-circle
Description
The goal circle is a circular feature on the field that houses the goal line
(see lacrosse_goal_line()
) and the goal. Notably, for fields with a
surrounding arc and/or fan around the goal area, this feature only
circumscribes the goal. Those features will be handled separately. This
feature may either be the full circle (e.g. all 360 degrees), or a partial
circle that may be greater than a half-circle
Usage
lacrosse_goal_circle(
goal_circle_radius = 0,
line_thickness = 0,
goal_circle_full_360 = TRUE,
goal_depth = 0,
goal_depth_to_circle = 0
)
Arguments
goal_circle_radius |
The outer radius of the goal circle |
line_thickness |
The thickness of the goal circle |
goal_circle_full_360 |
A boolean indicating whether the goal circle should be a 360 degree circle |
goal_depth |
The depth of the goal |
goal_depth_to_circle |
The distance from the back tip of the goal to the outer radius of the goal circle |
Value
A data frame containing the bounding coordinates of the goal circle
This feature is the area enclosed by the goal circle's outline. Please see
lacrosse_goal_circle()
for more information
Description
This feature is the area enclosed by the goal circle's outline. Please see
lacrosse_goal_circle()
for more information
Usage
lacrosse_goal_circle_fill(
goal_circle_radius = 0,
line_thickness = 0,
goal_circle_full_360 = TRUE,
goal_depth = 0,
goal_depth_to_circle = 0
)
Arguments
goal_circle_radius |
The outer radius of the goal circle |
line_thickness |
The thickness of the goal circle |
goal_circle_full_360 |
A boolean indicating whether the goal circle should be a 360 degree circle |
goal_depth |
The depth of the goal |
goal_depth_to_circle |
The distance from the back tip of the goal to the outer radius of the goal circle |
Value
A data frame containing the bounding coordinates of the goal circle's enclosed area
The goal arc fan is present on some fields (e.g. NCAAW) as a quarter-circle
located around the goal. The anchor for this feature should be given as the
center of the goal line, but the radius of the arc actually corresponds to
a point on the goal circle (see lacrosse_goal_circle()
) that runs through
y = 0
Description
The goal arc fan is present on some fields (e.g. NCAAW) as a quarter-circle
located around the goal. The anchor for this feature should be given as the
center of the goal line, but the radius of the arc actually corresponds to
a point on the goal circle (see lacrosse_goal_circle()
) that runs through
y = 0
Usage
lacrosse_goal_fan(
goal_fan_radius = 0,
goal_circle_radius = 0,
line_thickness = 0
)
Arguments
goal_fan_radius |
The outer radius of the goal fan, measured from the center of the goal line to the outer edge of the goal fan |
goal_circle_radius |
The radius of the goal circle |
line_thickness |
The thickness of the goal fan line |
Value
A data frame containing the bounding coordinates of the goal fan
The hash marks around the goal fan (see lacrosse_goal_fan()
) are drawn
independently from the goal fan itself. These should just be rectangles with
anchor points along the circle
Description
The hash marks around the goal fan (see lacrosse_goal_fan()
) are drawn
independently from the goal fan itself. These should just be rectangles with
anchor points along the circle
Usage
lacrosse_goal_fan_hash_mark(
goal_fan_hash_mark_length = 0,
line_thickness = 0,
rotational_angle = 0
)
Arguments
goal_fan_hash_mark_length |
The length of each hash mark along the goal fan |
line_thickness |
The thickness of each hash mark along the goal fan |
rotational_angle |
The angle (in degrees) that the hash mark should be rotated |
Value
A data frame containing the bounding coordinates of a hash mark along the goal fan
The goal frame is the posts through which the ball must pass in order to score a goal. It is usually triangular in shape
Description
The goal frame is the posts through which the ball must pass in order to score a goal. It is usually triangular in shape
Usage
lacrosse_goal_frame(
goal_frame_opening_interior = 0,
goal_post_thickness = 0,
goal_depth = 0
)
Arguments
goal_frame_opening_interior |
The interior width of the goal frame's opening |
goal_post_thickness |
The thickness of the goal post |
goal_depth |
The outer depth at which the goal is anchored |
Value
A data frame containing the bounding coordinates of the goal frame
The goal line is where the front edge of the goal sits. It spans the entire
interior dimension of the goal mouth. Its anchoring x
coordinate
should be its center (e.g. half of the line's width should be on each side of
the x
anchor)
Description
The goal line is where the front edge of the goal sits. It spans the entire
interior dimension of the goal mouth. Its anchoring x
coordinate
should be its center (e.g. half of the line's width should be on each side of
the x
anchor)
Usage
lacrosse_goal_line(
goal_frame_width = 0,
line_thickness = 0,
goal_line_full_diameter = FALSE,
goal_circle_radius = 0
)
Arguments
goal_frame_width |
The interior width of the goal frame's opening |
line_thickness |
The thickness of the goal line |
goal_line_full_diameter |
Whether or not the goal line should extend the
full diameter of the |
goal_circle_radius |
The outer radius of the goal circle |
Value
A data frame containing the bounding coordinates of the goal line
The goal mouth is similar to the goal fan, except it is plainly a semi-circle located in front of the goal on fields for which it appears. The separation between the ends of it typically correspond to the diameter of the goal circle
Description
The goal mouth is similar to the goal fan, except it is plainly a semi-circle located in front of the goal on fields for which it appears. The separation between the ends of it typically correspond to the diameter of the goal circle
Usage
lacrosse_goal_mouth(
goal_mouth_radius = 0,
line_thickness = 0,
goal_mouth_semi_circle_separation = 0
)
Arguments
goal_mouth_radius |
The outer radius of the goal mouth |
line_thickness |
The thickness of the line marking the goal mouth |
goal_mouth_semi_circle_separation |
The separation between the ends of the flat part of the semi-circle that is the goal mouth |
Value
A data frame containing the bounding coordinates of the goal mouth
The goal mouth may have a hash mark that extends towards midfield from the goal line extended. This is that hash mark, and should be anchored using its outer edge
Description
The goal mouth may have a hash mark that extends towards midfield from the goal line extended. This is that hash mark, and should be anchored using its outer edge
Usage
lacrosse_goal_mouth_hash_mark(
goal_mouth_hash_mark_length = 0,
line_thickness = 0
)
Arguments
goal_mouth_hash_mark_length |
The length from the goal line extended towards the center of the field that the hash mark extends |
line_thickness |
The thickness of the hash mark extending from the goal mouth |
Value
A data frame containing the bounding coordinates of the goal mouth's hash mark
The goal net is the netting that the ball must hit in order to score a point
Description
The goal net is the netting that the ball must hit in order to score a point
Usage
lacrosse_goal_net(
goal_frame_opening_interior = 0,
goal_post_thickness = 0,
goal_depth = 0
)
Arguments
goal_frame_opening_interior |
The interior width of the goal frame's opening |
goal_post_thickness |
The thickness of the goal post |
goal_depth |
The outer depth at which the goal is anchored |
Value
A data frame containing the bounding coordinates of the goal net
The neutral zone corresponds to the area between the restraining lines. In cases where there are no restraining lines, this feature will have 0 length
Description
The neutral zone corresponds to the area between the restraining lines. In cases where there are no restraining lines, this feature will have 0 length
Usage
lacrosse_neutral_zone(nzone_length = 0, field_width = 0)
Arguments
nzone_length |
The length of the neutral zone |
field_width |
The width of the field |
Value
A data frame containing the bounding coordinates of the neutral zone
The off-field officials' box is located between the two penalty boxes, opposite the team bench areas
Description
This will have the same thickness as the boards, but will be located outside the field surface
Usage
lacrosse_off_field_officials_box(
officials_box_thickness = 0,
officials_box_length = 0,
officials_box_depth = 0
)
Arguments
officials_box_thickness |
The thickness of the outline of the off-field officials' box |
officials_box_length |
The length of the off-field officials' box |
officials_box_depth |
The depth at which the off-field officials' box extends from the outer edge of the boards |
Value
A data frame containing the bounding coordinates of the off-field officials' box's outline
The offensive zone is where a team tries to score a goal. It is the TV-right area on the field
Description
The offensive zone is where a team tries to score a goal. It is the TV-right area on the field
Usage
lacrosse_offensive_zone(
field_length = 0,
field_width = 0,
corner_radius = 0,
nzone_length = 0,
field_shape = "rectangle"
)
Arguments
field_length |
The interior length of the field |
field_width |
The interior width of the field |
corner_radius |
The radius of the corner (assuming |
nzone_length |
The length of the neutral zone |
field_shape |
The shape of the field, passed as a string |
Value
A data frame of the bounding coordinates of the offensive zone
The penalty boxes are the areas outside the confines of the field where
players serve time for a penalty incurred. They are to be on the same side of
the field surface and separate, as close to center field as possible, for
each team. This will not include the off-field officials' box; see
lacrosse_off_field_officials_box()
for more information
Description
This will have the same thickness as the boards, but will be located outside the field surface
Usage
lacrosse_penalty_box_fill(
penalty_box_outline_thickness = 0,
penalty_box_length = 0,
penalty_box_depth = 0
)
Arguments
penalty_box_outline_thickness |
The thickness of the outline of the penalty box |
penalty_box_length |
The length of the penalty box |
penalty_box_depth |
The depth at which the penalty box extends from the outer edge of the boards |
Value
A data frame containing the bounding coordinates of the penalty box's inner filling
The penalty boxes are the areas outside the confines of the field where players serve time for a penalty incurred. They are to be on the same side of the field surface and separate, as close to center field as possible, for each team. This will also include the off-field officials' box
Description
This will have the same thickness as the boards, but will be located outside the field surface. Each penalty box's outline will share the same color as the boards
Usage
lacrosse_penalty_box_outline(
penalty_box_outline_thickness = 0,
penalty_box_length = 0,
penalty_box_width = 0,
penalty_box_separation = 0,
penalty_box_depth = 0
)
Arguments
penalty_box_outline_thickness |
The thickness of the outline of the penalty box |
penalty_box_length |
The length of the penalty box |
penalty_box_width |
The width of the penalty box |
penalty_box_separation |
The separation between the two penalty boxes |
penalty_box_depth |
The depth at which the penalty box extends from the outer edge of the boards |
Value
A data frame containing the bounding coordinates of the penalty box
The player benches are the areas outside the confines of the field where players not currently on the field are seated. They are to be on the same side of the field surface and separate, as close to center field as possible
Description
This will have the same thickness as the boards, but will be located outside the field surface
Usage
lacrosse_player_bench_area_fill(
bench_area_outline_thickness = 0,
bench_length = 0,
bench_depth = 0
)
Arguments
bench_area_outline_thickness |
The thickness of the outline of the player bench area |
bench_length |
The length of the player bench area |
bench_depth |
The depth of the player bench area |
Value
A data frame containing the bounding coordinates of the player bench area's inner filling
The player benches are the areas outside the confines of the field where players not currently on the field are seated. They are to be on the same side of the field surface and separate, as close to center field as possible
Description
This will have the same thickness as the boards, but will be located outside the field surface. Each bench's outline will share the same color as the boards
Usage
lacrosse_player_bench_outline(
bench_area_outline_thickness = 0,
bench_length = 0,
bench_depth = 0
)
Arguments
bench_area_outline_thickness |
The thickness of the outline of the player bench areas |
bench_length |
The length of the player bench area |
bench_depth |
The depth of the player bench area |
Value
A data frame containing the bounding coordinates of the player bench area
The referee's crease is a semi-circle on the "bottom" of the boards (in TV view), centered on the line y = 0 (the center of the center line)
Description
The referee's crease is a semi-circle on the "bottom" of the boards (in TV view), centered on the line y = 0 (the center of the center line)
The referee's crease is a semi-circle on the "bottom" of the boards (in TV view), centered on the line y = 0 (the center of the center line)
Usage
lacrosse_referee_crease(referee_crease_radius = 0, line_thickness = 0)
lacrosse_referee_crease(referee_crease_radius = 0, line_thickness = 0)
Arguments
referee_crease_radius |
The radius of the referee's crease |
line_thickness |
The thickness with which to draw the referee's crease |
Value
A data frame of the bounding coordinates of the referee's crease
A data frame of the bounding coordinates of the referee's crease
The referee's crease is a semi-circle on the "bottom" of the boards (in TV view), centered on the line y = 0 (the center of the center line). This feature corresponds to the section of the field it encloses
Description
The referee's crease is a semi-circle on the "bottom" of the boards (in TV view), centered on the line y = 0 (the center of the center line). This feature corresponds to the section of the field it encloses
Usage
lacrosse_referee_crease_fill(referee_crease_radius = 0, line_thickness = 0)
Arguments
referee_crease_radius |
The radius of the referee's crease |
line_thickness |
The thickness with which to draw the referee's crease |
Value
A data frame of the bounding coordinates of the referee's crease's enclosed area
The restraining line spans the entire width of the field (where present) and
connects to the defensive area lines (see lacrosse_defensive_area_line()
)
Description
The restraining line spans the entire width of the field (where present) and
connects to the defensive area lines (see lacrosse_defensive_area_line()
)
Usage
lacrosse_restraining_line(field_width = 0, line_thickness = 0)
Arguments
field_width |
The width of the field |
line_thickness |
The thickness of the restraining line |
Value
A data frame containing the bounding coordinates of the restraining line
The sidelines run the length of the field, with its interior edge designating the in-bounds area
Description
The sidelines run the length of the field, with its interior edge designating the in-bounds area
Usage
lacrosse_sideline(field_length = 0, line_thickness = 0)
Arguments
field_length |
The interior length of the field |
line_thickness |
The thickness of the sideline |
Value
A data frame containing the bounding coordinates of the sideline
The wing lines run parallel to the sidelines and cross the center line
Description
The wing lines run parallel to the sidelines and cross the center line
Usage
lacrosse_wing_line(wing_line_length = 0, line_thickness = 0)
Arguments
wing_line_length |
The length of the wing line |
line_thickness |
The thickness of the wing line |
Value
A data frame containing the bounding coordinates of the wing line
Load default parameters for a specified league. This should only be used when debugging the package
Description
Load default parameters for a specified league. This should only be used when debugging the package
Usage
load_default_parameters(
league = "",
display_range = "full",
court_updates = list(),
field_updates = list(),
pitch_updates = list(),
rink_updates = list(),
sheet_updates = list(),
color_updates = list(),
rotation = 0,
x_trans = 0,
y_trans = 0,
court_units = NULL,
field_units = NULL,
pitch_units = NULL,
rink_units = NULL,
sheet_units = NULL,
xlims = NULL,
ylims = NULL
)
Arguments
league |
The league to load into the global environment |
display_range |
The display range to load into the global environment |
court_updates |
The default |
field_updates |
The default |
pitch_updates |
The default |
rink_updates |
The default |
sheet_updates |
The default |
color_updates |
The default |
rotation |
The default rotation to load into the global environment.
This will default to |
x_trans |
The default translation in the |
y_trans |
The default translation in the |
court_units |
The default units for a court-like surface. The default
will be |
field_units |
The default units for a field-like surface. The default
will be |
pitch_units |
The default units for a pitch-like surface. The default
will be |
rink_units |
The default units for a rink-like surface. The default will
be |
sheet_units |
The default units for a sheet-like surface. The default
will be |
xlims |
The default limits on the plot to use in the |
ylims |
The default limits on the plot to use in the |
Value
Nothing, but environment variables should be set
Perform a mathematical reflection of coordinates over a specified axis
Description
Perform a mathematical reflection of coordinates over a specified axis
Usage
reflect(df, over_x = FALSE, over_y = TRUE)
Arguments
df |
The data frame to reflect. It must have |
over_x |
A boolean indicating whether or not to reflect over the x axis. Default: FALSE |
over_y |
A boolean indicating whether or not to reflect over the y axis. Default: TRUE |
Value
The reflected data frame
Examples
reflect(data.frame(x = 1, y = 0))
Perform a mathematical rotation about (0, 0) of coordinates. This rotation is given as x' = x \* cos(theta) - y \* sin(theta) y' = x \* sin(theta) + y \* cos(theta)
Description
Perform a mathematical rotation about (0, 0) of coordinates. This rotation is given as x' = x \* cos(theta) - y \* sin(theta) y' = x \* sin(theta) + y \* cos(theta)
Usage
rotate_coords(df, angle = 90)
Arguments
df |
The data frame to rotate. It must have |
angle |
the angle (in degrees) through which to rotate the coordinates |
Value
The rotated data frame
Examples
rotate_coords(data.frame(x = 0, y = 1))
The center circle is the circle located at the center of the field. Inside of the center circle is the center mark, where each half begins, as well as where play resumes following a goal
Description
The line thickness will be uniform for all features on the pitch
Usage
soccer_center_circle(feature_radius = 0, feature_thickness = 0)
Arguments
feature_radius |
The outer radius of the center circle |
feature_thickness |
The thickness of the center circle |
Value
A data frame containing the bounding coordinates of the center circle
The center mark is where kickoffs for each half, as well as following any goal, are taken. The radius should be given to the outside of the mark. This feature is located at midfield
Description
The center mark is where kickoffs for each half, as well as following any goal, are taken. The radius should be given to the outside of the mark. This feature is located at midfield
Usage
soccer_center_mark(feature_radius = 0)
Arguments
feature_radius |
The radius of the center mark on the pitch |
Value
A data frame containing the bounding coordinates of the center mark
The corner arcs are the quarter-circles located where the touchline meets the goal line
Description
The line thickness will be uniform for all features on the pitch
Usage
soccer_corner_arc(feature_radius = 0, feature_thickness = 0)
Arguments
feature_radius |
The outer radius of the corner arc |
feature_thickness |
The thickness of the corner arc |
Value
A data frame containing the bounding coordinates of the corner arc
The corner defensive marks on the pitch are typically located 9.15 meters (10 yards) from the corner of the pitch. Defenders should be beyond these marks (either more towards the goal or more towards the halfway line) during corner kicks
Description
The marks should be outside the field of play
Usage
soccer_corner_defensive_marks(
feature_thickness = 0,
is_touchline = FALSE,
is_goal_line = FALSE,
depth = 0,
separation_from_line = 0
)
Arguments
feature_thickness |
The thickness of the corner defensive marks |
is_touchline |
A boolean indicating whether or not the corner defensive marks should be along the touchline |
is_goal_line |
A boolean indicating whether or not the corner defensive marks should be along the goal line |
depth |
The depth that the mark extends out of play |
separation_from_line |
The distance from the back edge of the goal line to the interior edge of the corner defensive mark |
Details
The line thickness will be uniform for all features on the pitch
Value
A data frame containing the bounding coordinates of the corner defensive marks
Set the colors to be used for the plot. The values provided in the arguments are the defaults, and, where specified, are the rule-book specified values.
Description
Hexadecimal values are the passed vales to this function by default, but it
is also possible to use string-named values (e.g. "dodgerblue"
) when
specifying.
Usage
soccer_features_set_colors(
plot_background = NULL,
offensive_half_pitch = "#195f0c",
defensive_half_pitch = "#195f0c",
pitch_apron = "#195f0c",
touchline = "#ffffff",
goal_line = "#ffffff",
corner_arc = "#ffffff",
halfway_line = "#ffffff",
center_circle = "#ffffff",
center_mark = "#ffffff",
penalty_box = "#ffffff",
goal_box = "#ffffff",
penalty_mark = "#ffffff",
corner_defensive_mark = "#ffffff",
goal = "#ffffff"
)
Arguments
plot_background |
A hexadecimal string representing the color to use for this feature |
touchline |
A hexadecimal string representing the color to use for this feature |
goal_line |
A hexadecimal string representing the color to use for this feature |
halfway_line |
A hexadecimal string representing the color to use for this feature |
center_circle |
A hexadecimal string representing the color to use for this feature |
center_mark |
A hexadecimal string representing the color to use for this feature |
penalty_box |
A hexadecimal string representing the color to use for this feature |
goal_box |
A hexadecimal string representing the color to use for this feature |
penalty_mark |
A hexadecimal string representing the color to use for this feature |
corner_defensive_mark |
A hexadecimal string representing the color to use for this feature |
goal |
A hexadecimal string representing the color to use for this feature |
Value
A list of hexadecimal colors to use to color the features on the resulting plot
The goal is located beyond each goal line. By rule, the goal posts must be the same thickness as the goal line, and the posts must rest on the front edge of the goal line
Description
The line thickness will be uniform for all features on the pitch
Usage
soccer_goal(feature_thickness = 0, goal_width = 0, goal_depth = 0)
Arguments
feature_thickness |
The thickness of the goal |
goal_width |
The interior width of the goal |
goal_depth |
The depth to which the goal protrudes away from the back edge of the goal line |
Value
A data frame containing the bounding coordinates of the goal
The goal box is the smaller of the two boxes that extend from the goal line The goal box is usually 5.5 meters (6 yards) from the goal line, but may be parameterized via this function
Description
The line thickness will be uniform for all features on the pitch
Usage
soccer_goal_box(
feature_thickness = 0,
box_length = 0,
goal_width = 0,
goal_post_to_box_edge = 0
)
Arguments
feature_thickness |
The thickness of the goal box |
box_length |
The length of the goal box (from the goal line) |
goal_width |
The interior width of the goal |
goal_post_to_box_edge |
The distance from the interior of the goal post to the outer edge of the goal box |
Value
A data frame containing the bounding coordinates of the goal box
The goal line is the line that runs the full width of the pitch. The ball must completely cross the goal line to score a goal for the attacking team
Description
The line thickness will be uniform for all features on the pitch
Usage
soccer_goal_line(pitch_width = 0, feature_thickness = 0)
Arguments
pitch_width |
The width of the pitch |
feature_thickness |
The thickness of the goal line |
Value
A data frame containing the bounding coordinates of the goal line
Half of the pitch is located on each side of the halfway line (see
soccer_halfway_line()
for more information)
Description
Half of the pitch is located on each side of the halfway line (see
soccer_halfway_line()
for more information)
Usage
soccer_half_pitch(pitch_length = 0, pitch_width = 0)
Arguments
pitch_length |
The length of the pitch |
pitch_width |
The width of the pitch |
Value
A data frame containing the bounding coordinates of the half of the pitch
The halfway line, aka the midfield line or center line, runs the width of the pitch, dividing it into two equal halves. The left half (in TV view) will be the defensive half, and the right half will be the offensive half
Description
The line thickness will be uniform for all features on the pitch
Usage
soccer_halfway_line(pitch_width = 0, feature_thickness = 0)
Arguments
pitch_width |
The width of the pitch |
feature_thickness |
The thickness of the goal line |
Value
A data frame containing the bounding coordinates of the halfway line
The penalty box on the pitch is the larger of the two boxes that extend from the goal line. The penalty box is usually 16.5 meters (18 yards) from the goal line, but may be parameterized via this function
Description
This draws a half-box, which will include the circular portion at the top of the box. All dimensions given should be to the outside of the features
Usage
soccer_penalty_box(
feature_radius = 0,
feature_thickness = 0,
box_length = 0,
penalty_mark_dist = 0,
goal_width = 0,
goal_post_to_box_edge = 0
)
Arguments
feature_radius |
The radius of the circle at the top of the penalty box |
feature_thickness |
The thickness of the penalty box |
box_length |
The length of the penalty box (from the goal line) |
penalty_mark_dist |
The distance from the back edge of the goal line to the penalty mark |
goal_width |
The interior width of the goal |
goal_post_to_box_edge |
The distance from the interior of the goal post to the outer edge of the penalty box |
Details
The line thickness will be uniform for all features on the pitch
Value
A data frame containing the bounding coordinates of the penalty box
The penalty mark is the center point for the arc of the penalty box, as well as where any penalty kick is taken from
Description
The penalty mark is the center point for the arc of the penalty box, as well as where any penalty kick is taken from
Usage
soccer_penalty_mark(feature_radius = 0)
Arguments
feature_radius |
The radius of the penalty mark |
Value
A data frame containing the bounding coordinates of the penalty mark
The pitch should have an apron around it to do two things:
Description
Replicate the spacing between the goal line/touchline and the nearest ad boards
Usage
soccer_pitch_apron(
pitch_length = 0,
pitch_width = 0,
pitch_apron_touchline = 0,
pitch_apron_goal_line = 0,
goal_depth = 0
)
Arguments
pitch_length |
The length of the pitch |
pitch_width |
The width of the pitch |
pitch_apron_touchline |
The distance beyond the outer edge of the touchline that the pitch's apron should extend |
pitch_apron_goal_line |
The distance beyond the outer edge of the back of the goal that the pitch's apron should extend |
goal_depth |
The depth to which the goal protrudes away from the back edge of the goal line |
Details
Allow the goal line and touchline to be more clearly visible
This makes practical sense, as there is grass outside of the in-play area of the pitch
Value
A data frame containing the bounding coordinates of the pitch's apron
The lines that run the full length of the pitch are called the touchlines. In some cases, they may also be referred to as the sidelines, as they comprise the sides of the pitch
Description
The line thickness will be uniform for all features on the pitch
Usage
soccer_touchline(pitch_length = 0, feature_thickness = 0)
Arguments
pitch_length |
The length of the pitch |
feature_thickness |
The thickness of the touchline |
Value
A data frame containing the bounding coordinates of the touchline
surface_dimensions
Description
A list of lists (JSON) that associates a league with the appropriate dimensions to draw its surface. This data follows the current dimensions specified in the rule books, which can be found in the rule book directory
Details
A set of dimensions by sport and by league
The backcourt is the area behind the serviceline on the court, contained within the singles sidelines
Description
The backcourt is the area behind the serviceline on the court, contained within the singles sidelines
Usage
tennis_backcourt(court_length = 0, serviceline_distance = 0, singles_width = 0)
Arguments
court_length |
The length of the court |
serviceline_distance |
The distance from the net to the serviceline |
singles_width |
The width of the singles court |
Value
A data frame containing the bounding coordinates of the backcourt
The baseline is the line behind which a player will serve the ball. It spans the entire width of the court, and its back edge denotes the furthest boundary inside of which a ball can land and be considered in play
Description
The baseline is the line behind which a player will serve the ball. It spans the entire width of the court, and its back edge denotes the furthest boundary inside of which a ball can land and be considered in play
Usage
tennis_baseline(court_width = 0, feature_thickness = 0)
Arguments
court_width |
The width of the court |
feature_thickness |
The thickness of the baseline |
Value
A data frame containing the bounding coordinates of the baseline
The center mark identifies the center point of the
tennis_baseline()
. The line should extend towards the net
Description
The center mark identifies the center point of the
tennis_baseline()
. The line should extend towards the net
Usage
tennis_center_mark(center_mark_length = 0, feature_thickness = 0)
Arguments
center_mark_length |
The length of the center mark as measured from the back edge of the baseline |
feature_thickness |
The thickness of the center mark |
Value
A data frame containing the bounding coordinates of the center mark
The center serviceline on the court divides the service area into two parts: the ad court (left) and the deuce court (right)
Description
This line extends from the net to the back edge of the serviceline, and is
centered on the line x = 0
Usage
tennis_center_serviceline(center_serviceline_length = 0, feature_thickness = 0)
Arguments
center_serviceline_length |
The length of the center serviceline from
the net to the back edge of the serviceline (see |
feature_thickness |
The thickness of the center serviceline |
Value
A data frame containing the bounding coordinates of the center serviceline
The court apron is referred to as the backstop and sidestop. These areas are entirely outside of the playing court, but legal shots made here are considered in play
Description
The court apron is referred to as the backstop and sidestop. These areas are entirely outside of the playing court, but legal shots made here are considered in play
Usage
tennis_court_apron(
court_length = 0,
court_width = 0,
backstop_distance = 0,
sidestop_distance = 0
)
Arguments
court_length |
The length of the court |
court_width |
The width of the court (usually the doubles width of the court) |
backstop_distance |
The distance from the back edge of the
|
sidestop_distance |
The distance from the outer edge of the
|
Value
A data frame containing the bounding coordinates of the court apron
The doubles alley is the area between the singles and doubles sideline. It should run the entire length of the court
Description
The doubles alley is the area between the singles and doubles sideline. It should run the entire length of the court
Usage
tennis_doubles_alley(court_length = 0, feature_thickness = 0)
Arguments
court_length |
The length of the court |
feature_thickness |
The thickness of the doubles alley (this is the distance between the singles and doubles sidelines) |
Value
A data frame containing the bounding coordinates of the doubles alley
Set the colors to be used for the plot. The values provided in the arguments are the defaults, and, where specified, are the rule-book specified values.
Description
Hexadecimal values are the passed vales to this function by default, but it
is also possible to use string-named values (e.g. "dodgerblue"
) when
specifying.
Usage
tennis_features_set_colors(
plot_background = NULL,
baseline = "#ffffff",
singles_sideline = "#ffffff",
doubles_sideline = "#ffffff",
serviceline = "#ffffff",
center_serviceline = "#ffffff",
center_mark = "#ffffff",
ad_court = "#395d33",
deuce_court = "#395d33",
backcourt = "#395d33",
doubles_alley = "#395d33",
court_apron = "#395d33",
net = "#d3d3d3"
)
Arguments
plot_background |
A hexadecimal string representing the color to use for this feature |
baseline |
A hexadecimal string representing the color to use for this feature |
singles_sideline |
A hexadecimal string representing the color to use for this feature |
doubles_sideline |
A hexadecimal string representing the color to use for this feature |
serviceline |
A hexadecimal string representing the color to use for this feature |
center_serviceline |
A hexadecimal string representing the color to use for this feature |
center_mark |
A hexadecimal string representing the color to use for this feature |
ad_court |
A hexadecimal string representing the color to use for this feature |
deuce_court |
A hexadecimal string representing the color to use for this feature |
backcourt |
A hexadecimal string representing the color to use for this feature |
doubles_alley |
A hexadecimal string representing the color to use for this feature |
court_apron |
A hexadecimal string representing the color to use for this feature |
net |
A hexadecimal string representing the color to use for this feature |
Value
A list of hexadecimal colors to use to color the features on the resulting plot
The front court is the area between the tennis_net()
and the
tennis_serviceline()
. left-hand side of the court when facing the net from
the nearest baseline is the ad court, and the right-hand side is the deuce
court. This is constrained by the singles tennis_sideline()
.
Description
This is one half of the front court (either the ad or deuce court)
Usage
tennis_frontcourt_half(serviceline_distance = 0, singles_width = 0)
Arguments
serviceline_distance |
The distance from the net to the serviceline |
singles_width |
The width of the singles court |
Value
A data frame containing the bounding coordinates of one half of the frontcourt
The net divides the court into two halves, and should run through the line
x = 0
when viewing the court in TV view
Description
The net divides the court into two halves, and should run through the line
x = 0
when viewing the court in TV view
Usage
tennis_net(feature_thickness = 0, net_length = 0)
Arguments
feature_thickness |
The thickness of the net |
net_length |
The length of the net |
Value
A data frame containing the bounding coordinates of the net
The serviceline is the line in front of which (nearest the net) a serve must land, and be on the proper side of the court to be considered legal and in play
Description
This line extends completely between the singles sidelines (but not extend to the doubles sidelines)
Usage
tennis_serviceline(singles_width = 0, feature_thickness = 0)
Arguments
singles_width |
The width of the singles court |
feature_thickness |
The thickness of the serviceline |
Value
A data frame containing the bounding coordinates of the serviceline
The sideline runs the entire length of the court, and there may be up to four
sidelines on the court (this may refer to either the singles or doubles
sideline). Lines are considered in play, so the outer edge of the sideline
will lie along x = court_width / 2
Description
The sideline runs the entire length of the court, and there may be up to four
sidelines on the court (this may refer to either the singles or doubles
sideline). Lines are considered in play, so the outer edge of the sideline
will lie along x = court_width / 2
Usage
tennis_sideline(court_length = 0, feature_thickness = 0)
Arguments
court_length |
The length of the court |
feature_thickness |
The thickness of the sideline |
Value
A data frame containing the bounding coordinates of the sideline
The attack line runs from sideline to sideline separating the court's
backcourt (volleyball_backcourt()
) from the front zone
(volleyball_front_zone()
). Players in the front row may attack from either
side of this line, while players in the back row must begin their attack from
the backcourt side of the line. The anchor point of this feature should be
its outer edge
Description
The attack line runs from sideline to sideline separating the court's
backcourt (volleyball_backcourt()
) from the front zone
(volleyball_front_zone()
). Players in the front row may attack from either
side of this line, while players in the back row must begin their attack from
the backcourt side of the line. The anchor point of this feature should be
its outer edge
Usage
volleyball_attack_line(court_width = 0, line_thickness = 0)
Arguments
court_width |
The width of the court, measured from the exterior edges of the sidelines |
line_thickness |
The thickness of the attack line |
Value
A data frame containing the bounding box of the attack line
The backcourt is the area between the the attack line (see
volleyball_attack_line()
) and the end line (see volleyball_end_line()
).
Players playing in the back row of the rotation must take off from this area
before attacking the ball. If considering the entirety of the volleyball
court as being divided into thirds, this is either of the outer thirds of
the court
Description
The backcourt is the area between the the attack line (see
volleyball_attack_line()
) and the end line (see volleyball_end_line()
).
Players playing in the back row of the rotation must take off from this area
before attacking the ball. If considering the entirety of the volleyball
court as being divided into thirds, this is either of the outer thirds of
the court
Usage
volleyball_backcourt(
attack_line_edge_to_center_line = 0,
court_length = 0,
court_width = 0
)
Arguments
attack_line_edge_to_center_line |
The distance from the edge furthest
from the attack line to the center of the line running along |
court_length |
The length of the court, measured from the exterior edges of the end lines |
court_width |
The width of the court, measured from the exterior edges of the sidelines |
Value
A data frame containing the bounding coordinates of the backcourt
The center line's axis runs along x = 0
when viewing the court in TV
view, dividing the court into two equal halves
Description
The center line's axis runs along x = 0
when viewing the court in TV
view, dividing the court into two equal halves
Usage
volleyball_center_line(court_width = 0, line_thickness = 0)
Arguments
court_width |
The width of the court, measured from the exterior edges of the sidelines |
line_thickness |
The thickness of the center line |
Value
A data frame containing the bounding box of the center line
The court apron is similar to the basketball_court_apron()
in that it is
the area outside the court. It may be the same color as the interior of the
court, but isn't necessarily. Unlike basketball_court_apron()
however, the
boundary line thickness doesn't matter since the lines are considered in-play
and therefore are included in the court's length and width. This is a colored
area inside of the free zone (see volleyball_free_zone()
).
Description
The court apron is similar to the basketball_court_apron()
in that it is
the area outside the court. It may be the same color as the interior of the
court, but isn't necessarily. Unlike basketball_court_apron()
however, the
boundary line thickness doesn't matter since the lines are considered in-play
and therefore are included in the court's length and width. This is a colored
area inside of the free zone (see volleyball_free_zone()
).
Usage
volleyball_court_apron(
court_length = 0,
court_width = 0,
court_apron_end_line = 0,
court_apron_sideline = 0
)
Arguments
court_length |
The length of the court, measured from the exterior edges of the end lines |
court_width |
The width of the court, measured from the exterior edges of the sidelines |
court_apron_end_line |
The distance the court apron extends beyond the outer edge of the end line |
court_apron_sideline |
The distance the court apron extends beyond the outer edge of the sideline |
Value
A data frame containing the bounding coordinates of the court apron
The lines on the court that run the full width of the court are referred to as the end lines, with the full width of the line being considered in bounds
Description
The lines on the court that run the full width of the court are referred to as the end lines, with the full width of the line being considered in bounds
Usage
volleyball_end_line(court_width = 0, line_thickness = 0)
Arguments
court_width |
The width of the court, measured from the exterior edges of the sidelines |
line_thickness |
The thickness of the end line |
Value
A data frame containing the bounding box of the end line
Set the colors to be used for the plot. The values provided in the arguments are the defaults, and, where specified, are the rule-book specified values.
Description
Hexadecimal values are the passed vales to this function by default, but it
is also possible to use string-named values (e.g. "dodgerblue"
) when
specifying.
Usage
volleyball_features_set_colors(
plot_background = NULL,
free_zone = "#d2ab6f",
front_zone = "#d2ab6f",
defensive_backcourt = "#d2ab6f",
offensive_backcourt = "#d2ab6f",
court_apron = "#d2ab6f",
end_line = "#000000",
sideline = "#000000",
attack_line = "#000000",
center_line = "#000000",
service_zone_mark = "#000000",
substitution_zone = "#000000"
)
Arguments
plot_background |
A hexadecimal string representing the color to use for this feature |
free_zone |
A hexadecimal string representing the color to use for this feature |
front_zone |
A hexadecimal string representing the color to use for this feature |
defensive_backcourt |
A hexadecimal string representing the color to use for this feature |
offensive_backcourt |
A hexadecimal string representing the color to use for this feature |
court_apron |
A hexadecimal string representing the color to use for this feature |
end_line |
A hexadecimal string representing the color to use for this feature |
sideline |
A hexadecimal string representing the color to use for this feature |
attack_line |
A hexadecimal string representing the color to use for this feature |
center_line |
A hexadecimal string representing the color to use for this feature |
service_zone_mark |
A hexadecimal string representing the color to use for this feature |
substitution_zone |
A hexadecimal string representing the color to use for this feature |
Value
A list of hexadecimal colors to use to color the features on the resulting plot
The free zone is similar to the basketball_court_apron()
in that it is the
area outside the court. It may be the same color as the interior of the
court, but isn't necessarily. Unlike basketball_court_apron()
however, the
boundary line thickness doesn't matter since the lines are considered in-play
and therefore are included in the court's length and width. This is not the
same as the volleyball_court_apron()
, as this is the entire area outside of
the court's lines, while the court apron corresponds to a colored apron
inside the free zone
Description
The free zone is similar to the basketball_court_apron()
in that it is the
area outside the court. It may be the same color as the interior of the
court, but isn't necessarily. Unlike basketball_court_apron()
however, the
boundary line thickness doesn't matter since the lines are considered in-play
and therefore are included in the court's length and width. This is not the
same as the volleyball_court_apron()
, as this is the entire area outside of
the court's lines, while the court apron corresponds to a colored apron
inside the free zone
Usage
volleyball_free_zone(
court_length = 0,
court_width = 0,
free_zone_end_line = 0,
free_zone_sideline = 0
)
Arguments
court_length |
The length of the court, measured from the exterior edges of the end lines |
court_width |
The width of the court, measured from the exterior edges of the sidelines |
free_zone_end_line |
The distance the free zone extends beyond the outer edge of the end line |
free_zone_sideline |
The distance the free zone extends beyond the outer edge of the sideline |
Value
A data frame containing the bounding coordinates of the free zone
The front zone is the area between the attack line (see
volleyball_attack_line()
) and the line running along x = 0
. If
considering the entirety of the volleyball court as being divided into
thirds, this is half of the middle third of the court
Description
The front zone is the area between the attack line (see
volleyball_attack_line()
) and the line running along x = 0
. If
considering the entirety of the volleyball court as being divided into
thirds, this is half of the middle third of the court
Usage
volleyball_front_zone(attack_line_edge_to_center_line = 0, court_width = 0)
Arguments
attack_line_edge_to_center_line |
The distance from the edge furthest
from the attack line to the center of the line running along |
court_width |
The width of the court, measured from the exterior edges of the sidelines |
Value
A data frame containing the bounding coordinates of the center zone
The service zone marks are the lines beyond the end lines that denote where a
legal serve must take place. These appear as four hash marks that are out of
bounds of the court, but contained within the free zone (see
volleyball_free_zone()
for reference)
Description
The service zone marks are the lines beyond the end lines that denote where a
legal serve must take place. These appear as four hash marks that are out of
bounds of the court, but contained within the free zone (see
volleyball_free_zone()
for reference)
Usage
volleyball_service_zone_mark(service_zone_mark_length = 0, line_thickness = 0)
Arguments
service_zone_mark_length |
The distance the service zone mark extends away from the outer edge of the end line |
line_thickness |
The thickness of the service zone marks |
Value
A data frame containing the bounding box of the service zone mark
The lines on the court that run the full length of the court are referred to as the sidelines, with the full width of the line being considered in bounds
Description
The lines on the court that run the full length of the court are referred to as the sidelines, with the full width of the line being considered in bounds
Usage
volleyball_sideline(court_length = 0, line_thickness = 0)
Arguments
court_length |
The length of the court, measured from the exterior edges of the end lines |
line_thickness |
The thickness of the sideline |
Value
A data frame containing the bounding box of the sideline
The substitution zone is typically marked by a dashed line extending from the
attack lines (see volleyball_attack_line()
for more). This creates a single
dash, and the dashes should be added to the plot accordingly
Description
The substitution zone is typically marked by a dashed line extending from the
attack lines (see volleyball_attack_line()
for more). This creates a single
dash, and the dashes should be added to the plot accordingly
Usage
volleyball_substitution_zone_dash(dash_length = 0, line_thickness = 0)
Arguments
dash_length |
The length of the dash to draw |
line_thickness |
The thickness of the substitution zone dashes |
Value
A data frame containing the bounding box of a single dash of the substitution zone