-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
68 lines (47 loc) · 1.98 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
58
59
60
61
62
63
64
65
66
67
---
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%"
)
```
# royale <img src="man/figures/logo.png" align="right" height="138" />
<!-- badges: start -->
[![R-CMD-check](https://github.com/christopherkenny/royale/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/christopherkenny/royale/actions/workflows/R-CMD-check.yaml)
[![royale status badge](https://christopherkenny.r-universe.dev/badges/royale)](https://christopherkenny.r-universe.dev/royale)
[![](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
<!-- badges: end -->
`royale` provides an R interface to the [Clash Royale API](https://developer.clashroyale.com/#/).
## Installation
You can install the development version of `royale` from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("christopherkenny/royale")
```
## Example
Current endpoints are included for cards, rankings, tournaments, players, and clans.
To get a player's data, we can use:
```{r}
library(royale)
cr_get_player('JYJQC88')
```
To get a clan, we can use:
```{r}
clan <- cr_get_clan('99R2PQVR')
clan
```
Clans are put into long form, so each player in a clan is an observation:
```{r}
clan |>
dplyr::relocate(dplyr::starts_with('player'), .before = dplyr::everything())
```
## RoyaleAPI Proxy
If you are using a RoyaleAPI proxy, this can be configured by setting `options(royale.use_proxy = TRUE)`.
This can be turned off by setting `options(royale.use_proxy = FALSE)`. It is off by default.
## Disclaimer
**This content is not affiliated with, endorsed, sponsored, or specifically approved by Supercell and Supercell is not responsible for it. For more information see Supercell’s Fan Content Policy: <www.supercell.com/fan-content-policy>.**