dst_split_plot: Plot Distance Split

Description Usage Arguments Examples

View source: R/distance_plot.R

Description

Various slope graphs for distance race splits.

Usage

1
2
3
4
5
6
7
dst_split_plot(
  data,
  type = c("rank", "time", "percent"),
  nation_col = NULL,
  name_col = NULL,
  offset.x = 0.25
)

Arguments

data

data.frame, as returned by parse_dst_pdf

type

character; one of "rank", "time" or "percent"; controls whether the y axis is split rank, split time back or split percent back. Note that both "time" and "percent" will usually lead to a fair amount of overplotting of the athlete names due to space constraints.

nation_col

character vector; if specified, highlight athletes from these nations. Use the three letter codes, all caps. e.g. nation_col = c("NOR","RUS"). You can only specify one of nation_col or name_col.

name_col

character vector; if specified, highlight these. Must spell out each athlete's full name as it appears in data, exactly. e.g. name_col = c("HOFFMAN Noah","HARVEY Alex") You can only specify one of nation_col or name_col.

offset.x

numeric; amount to slide the names to the left/right

Examples

1
2
3
4
5
6
7
8
## Not run: 
require(ggplot2)
dst <- parse_dst_pdf(file = system.file("example_pdfs/dst_example1.pdf",
                                       package = "fispdfparsr"))
p <- dst_split_plot(data = dst,type = "percent",nation_col = c("USA","CAN"))
print(p)

## End(Not run)

joranE/fispdfparsr documentation built on Sept. 6, 2021, 9:23 p.m.