knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

rugger

:new_zealand: :ireland: r emo::ji("wales") r emo::ji("england") :south_africa: :australia: r emo::ji("scotland") :fiji: ^[Black flags?! They're Github's fault. The flags represent the rankings as of the end of 2018 -- New Zealand, Ireland, Wales, England, South Africa, Australia, Scotland and Fiji. You can see them in R with emo::ji("wales"), for example, using the emo package, available from https://github.com/hadley/emo.]

rugger is a rrrrugby package :rugby_football:. Get stats on teams, players, rankings and calculate changes in the rankings for a certain match.

Installation

You can install rugger with:

``` {r eval = FALSE} remotes::install_github("RobertMyles/rugger")

I won't be burdening CRAN with it.  

## Usage

You can see the current world rankings with `get_rankings()`:

```r
library(rugger)
get_rankings()

Hmmm, what would happen if New Zealand played Ireland tomorrow, and Ireland won by 5 points?

calculate_rank("New Zealand", "Ireland", score = c(15, 20))

Let's have a look at the history between England and Scotland, the first two teams to play the game:

get_team_records("England", "Scotland")

England winning almost 62% of the matches there.

I wonder which player has scored most tries in rugby?

library(dplyr)

get_team_records(type = "player") %>% 
  arrange(desc(points)) %>% 
  select(player, points)

The sublime Dan Carter!

Data etc.

All of the data acessed by this package is obviously for informational/educational use, and a big thanks to all for making it available.

It belongs to World Rugby and ESPN. The algorithm that calculates the rankings also belongs to World Rugby, you can read about it here. Some of the data is also pulled from Pick and Go by Lassen Creative Technologies.



RobertMyles/rugger documentation built on Jan. 13, 2020, 11:33 a.m.