-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
64 lines (44 loc) · 1.77 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
---
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%"
)
```
# usportsR
<!-- badges: start -->
[![R-CMD-check](https://github.com/uwaggs/usportsR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/uwaggs/usportsR/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
`usportsR` is a package that is designed to provide users with data from all Usports
sanctioned sports.
- The package contains U Sports data spanning over a decade of pre-season, regular season, and post-season matches.
- Sports currently included are Soccer, Basketball, Ice Hockey, Field Hockey, Track and Field
Field Hockey, Football, Wrestling, Swimming and Rugby
- We currently provide access to box score, play-by-play, schedules and rankings data
## Installation
You can install the development version of usportsR from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("uwaggs/usportsR")
```
## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(usportsR)
library(dplyr)
## basic example to find number of 40+ point games in the last decade
mens_player_box_scores <- basketball_player_box_score("m",c(2023,2022,2021,2019,2018,2017,2016,2015,2014))
mens_40_pt_games <- mens_player_box_scores %>% filter(pts >= 40)
head(mens_40_pt_games,10)
```
```{r}
library(ggplot2)
## simple plot to illustrate points vs assists in 40+ point games in Usport basketball games
ggplot(mens_40_pt_games,aes(x = pts,y = ast)) + geom_point() +
labs(title = "Points Vs Assists in 40 point games", x = "Points",y = "Assists")
```