Basic_Ex.RmdThe following sports are supported by collegeballR
| names | id |
| baseball | MBA |
| mens basketball | MBB |
| football | MFB |
| mens ice hockey | MIH |
| mens lacrosse | MLA |
| mens soccer | MSO |
| mens tennis | MTE |
| mens volleyball | MVB |
| womens basketball | WBB |
| field hockey | WFH |
| womens ice hockey | WIH |
| womens lacrosse | WLA |
| softball | WSB |
| womens soccer | WSO |
| womens beach volleyball | WSV |
| womens tennis | WTE |
| womens volleyball | WVB |
The team mapping function helps identify the team_id associated with specific teams for different sports. This is vital to know when using player_stats or team_stats.
teams <- team_mapping(2016,"Men's Basketball")
head(teams,6)| team_id | team_name | year |
| 26172 | A&M-Corpus Christi | 2.02e+03 |
| 2 | Abilene Christian | 2.02e+03 |
| 721 | Air Force | 2.02e+03 |
| 5 | Akron | 2.02e+03 |
| 8 | Alabama | 2.02e+03 |
| 6 | Alabama A&M | 2.02e+03 |
Let’s look at a quick example for the Texas A&M Women’s Soccer team.
tamu_ws <- team_stats(697, 2015, "Women's Soccer",by="Season")
table2 <- huxtable(tamu_ws,add_colnames = T) %>%
theme_article %>%
set_top_border(1,1,1)
caption(table2) <- "Table 2. TAMU Women's Soccer 2015"
wrap(table2) <- TRUE
table2| Player | Goals | Assists | Points | ShAtt | Fouls | Red Cards | Yellow Cards | GC | Goal App | GGS | Goalie Min. Plyd | GA | GAA | Saves | SV Pct | Shutouts | G Wins | G Loss | DSaves | Corners | PS | PSA | GWG | year |
| Totals | 71 | 60 | 202 | 544 | 217 | 10 | 148,148 | 27 | 0.984 | 87 | 0.763 | 9 | 156 | 1 | 2 | 22 | 2.02e+03 | |||||||
| Opponent Totals | 27 | 22 | 76 | 296 | 297 | 1 | 27 | 148,148 | 71 | 2.59 | 184 | 0.722 | 1 | 105 | 1 | 1 | 3 | 2.02e+03 |
Here is a simple example of how to extract player stats, you can navigate to the other vignette for a more advanced example using purrr.
tamu_p_mbb <- player_stats(697, 2015, "MBB",by="Season")
table3 <- huxtable(tamu_p_mbb,add_colnames = T) %>%
theme_article %>%
set_top_border(1,1,1)
caption(table3) <- "Table 3. TAMU Men's Basketball 2015 - Player Stats"
wrap(table3) <- TRUE
table3| Jersey | Player | Yr | Pos | Ht | GP | GS | MP | FGM | FGA | FG% | 3FG | 3FGA | 3FG% | FT | FTA | FT% | PTS | Avg | ORebs | DRebs | Tot Reb | Avg | AST | TO | STL | BLK | Fouls | Dbl Dbl | Trpl Dbl | DQ | year | team_id |
| 5 | Green, Jordan | Sr | G | 6-5 | 33 | 33 | 803:00 | 71 | 143 | 49.6 | 16 | 42 | 38.1 | 43 | 55 | 78.2 | 201 | 6.09 | 12 | 49 | 61 | 1.85 | 61 | 35 | 15 | 4 | 68 | 2 | 2.02e+03 | 697 | ||
| 21 | Caruso, Alex | Jr | G | 6-5 | 33 | 33 | 1038:00 | 106 | 229 | 46.3 | 26 | 71 | 36.6 | 63 | 92 | 68.5 | 301 | 9.12 | 24 | 126 | 150 | 4.55 | 182 | 100 | 69 | 2 | 67 | 1 | 1 | 2.02e+03 | 697 | |
| 14 | Roberson, Kourtney | Sr | F | 6-9 | 33 | 32 | 795:00 | 117 | 186 | 62.9 | 55 | 92 | 59.8 | 289 | 8.76 | 81 | 132 | 213 | 6.45 | 37 | 33 | 17 | 13 | 76 | 3 | 1 | 2.02e+03 | 697 | ||||
| 3 | Robinson, Alex | Fr | G | 6-1 | 32 | 0 | 601:00 | 65 | 155 | 41.9 | 13 | 36 | 36.1 | 22 | 37 | 59.5 | 165 | 5.16 | 15 | 60 | 75 | 2.34 | 84 | 53 | 15 | 2 | 45 | 2.02e+03 | 697 | |||
| 22 | Allen, Peyton | Fr | G | 6-5 | 32 | 8 | 452:00 | 49 | 129 | 38 | 30 | 93 | 32.3 | 16 | 20 | 80 | 144 | 4.5 | 5 | 19 | 24 | 0.75 | 15 | 18 | 8 | 4 | 42 | 2.02e+03 | 697 | |||
| 12 | Jones, Jalen | Jr | F | 6-7 | 31 | 31 | 892:00 | 148 | 329 | 45 | 12 | 40 | 30 | 118 | 162 | 72.8 | 426 | 13.7 | 59 | 147 | 206 | 6.65 | 25 | 45 | 30 | 17 | 79 | 2 | 1 | 2.02e+03 | 697 | |
| 10 | Trocha-Morelos, Tonny | Fr | C | 6-10 | 29 | 1 | 297:00 | 18 | 64 | 28.1 | 5 | 0 | 7 | 19 | 36.8 | 43 | 1.48 | 23 | 34 | 57 | 1.97 | 5 | 11 | 6 | 12 | 33 | 2.02e+03 | 697 | ||||
| 23 | House, Danuel | Jr | G | 6-7 | 26 | 23 | 845:00 | 125 | 300 | 41.7 | 62 | 155 | 40 | 72 | 112 | 64.3 | 384 | 14.8 | 22 | 76 | 98 | 3.77 | 55 | 50 | 17 | 16 | 42 | 2.02e+03 | 697 | |||
| 15 | Fitzgerald, Davonte | So | F | 6-7 | 25 | 2 | 240:00 | 29 | 89 | 32.6 | 16 | 53 | 30.2 | 14 | 21 | 66.7 | 88 | 3.52 | 11 | 29 | 40 | 1.6 | 4 | 16 | 3 | 5 | 22 | 2.02e+03 | 697 | |||
| 4 | Miller, Tavario | So | F | 6-7 | 25 | 0 | 283:00 | 28 | 44 | 63.6 | 1 | 0 | 11 | 27 | 40.7 | 67 | 2.68 | 34 | 42 | 76 | 3.04 | 5 | 18 | 1 | 9 | 62 | 1 | 2.02e+03 | 697 | |||
| 24 | Space, Antwan | Jr | F | 6-8 | 21 | 2 | 261:00 | 33 | 71 | 46.5 | 4 | 17 | 23.5 | 19 | 32 | 59.4 | 89 | 4.24 | 19 | 41 | 60 | 2.86 | 6 | 18 | 4 | 9 | 37 | 2.02e+03 | 697 | |||
| 45 | Johns, Dylan | So | G | 6-11 | 13 | 0 | 70:00 | 7 | 12 | 58.3 | 2 | 2 | 100 | 16 | 1.23 | 5 | 6 | 11 | 0.85 | 3 | 5 | 1 | 3 | 11 | 2.02e+03 | 697 | ||||||
| 25 | Dobbins, Kyle | So | G | 6-0 | 6 | 0 | 9:00 | 1 | 3 | 33.3 | 1 | 0 | 2 | 0.33 | 2 | 2 | 1 | 2.02e+03 | 697 | |||||||||||||
| 20 | Collins, Chris | Fr | G | 6-3 | 3 | 0 | 5:00 | 1 | 1 | 100 | 1 | 1 | 100 | 3 | 1 | 2 | 2.02e+03 | 697 | ||||||||||||||
| 33 | White, Ramon | Jr | G | 6-2 | 1 | 0 | 1:00 | 2.02e+03 | 697 | |||||||||||||||||||||||
| 13 | Aparicio, Juan | Jr | G | 6-4 | 1 | 0 | 2:00 | 3 | 1 | 1 | 1 | 1 | 2.02e+03 | 697 |
```