hth_dst: Head-to-head Plots & Data

Description Usage Arguments Value Examples

View source: R/head_to_head.R

Description

Sprint and distance head-to-head plots and accompanying data. Use these to compare some athletes (ath1) to a collection of other athletes (ath2).

Usage

1
2
3
4
5
hth_dst(ath1, ath2, races = c("maj_int", "fis"), measure = c("fispoints",
  "rank", "pb"), by_tech = FALSE, by_start = FALSE)

hth_spr(ath1, ath2, races = c("maj_int", "fis"), measure = c("fispoints",
  "rank"), by_tech = FALSE, by_start = FALSE)

Arguments

ath1

character; single athlete name of interest

ath2

character vector of athlete names to compare with

races

character; one of "maj_int" (major international races) or "fis" (all FIS races).

measure

character; one of "fispoints", "rank", "pb".

by_tech

boolean; split trend lines by technique. Only one of by_tech and by_start can by TRUE.

by_start

boolean; split trend lines by race type. Only one of by_tech and by_start can by TRUE. Ignored for sprint race comparisons

Value

A named list with components:

  1. plot - ggplot2 plot object

  2. data - raw head-to-head results data

  3. line_data - summarised head-to-head data for plotted lines

  4. block - data useful only for constructing the plot

Examples

1
2
3
4
5
6
7
8
## Not run: 
p <- hth_dst(ath1 = 'DIGGINS Jessica',
             ath2 = c('RANDALL Kikkan','BJORNSEN Sadie','SARGENT Ida'),
             races = "fis",
             measure = "pb")
print(p$plot)

## End(Not run)

joranE/statskier2 documentation built on May 19, 2019, 8:42 p.m.