-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
57 lines (39 loc) · 1.43 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ggfootball <img src="inst/figures/logo.png" align="right" height="138"/>
*It's Football not Soccer.*
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
<!-- badges: end -->
## Overview
An R package for plotting [understat](https://understat.com/) data; an xG chart and an xG map.
## Installation
You can install the development version of ggfootball from [GitHub](https://github.com/) with:
``` r
pak::pak("aymennasri/ggfootball")
```
## Example
```{r eval=FALSE}
library(ggfootball)
# xG chart
xg_chart(match_id = 26631,
home_team_color = "red",
away_team_color = "grey",
competition = "Premier League",
background_color = "#FFF1E5")
# Shot/xG map
xg_map(match_id = 26631, title = "xG Map")
```
## Acknowledgements
- [Ewen Henderson](https://ewen.io/) for his amazing [{understatr}](https://ewenme.github.io/understatr/) package which I used to extract data.
- [Guangchuang YU](https://yulab-smu.top/) for his [{hexSticker}](https://github.com/GuangchuangYu/hexSticker) package which I used to create the logo for this package.