
sportsR: A Comprehensive Collection of Sports and Athletics Datasets
Source:vignettes/sportsR.Rmd
sportsR.Rmd
library(sportsR)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(ggplot2)Introduction
The sportsR package offers a rich and diverse collection
of datasets focused on sports, athletics, physical performance, and
related disciplines. It includes comprehensive data on topics such as
player and team performance, match statistics, tournament
results, championship standings, Olympic and international competitions,
rankings, coaching and training, biomechanics, sports medicine,
injuries, exercise physiology, fitness assessment, sports nutrition,
wearable sensor measurements, talent identification, and sports
analytics.
The package contains a wide variety of data types, including professional and amateur sports records, longitudinal performance measurements, physiological and biomechanical assessments, player demographic and career data, historical competition results, and economic and management datasets. These datasets encompass team sports such as soccer, basketball, baseball, American football, volleyball, rugby, cricket, hockey, and handball, as well as individual sports including tennis, badminton, table tennis, golf, swimming, cycling, athletics, gymnastics, wrestling, boxing, martial arts, weightlifting, triathlon, rowing, canoeing, climbing, surfing, skiing, snowboarding, and motorsports. Additional datasets cover referee decisions, fan engagement, and sports management data obtained from public repositories, official organizations, research publications, and educational resources.
All datasets within agridatasets
view_datasets_sportsR()
#> [1] "atp_matches_2019" "english_football" "italian_football" "mlb_teams_2019"
#> [5] "mlb_teams_2024" "pga_results" "warriors_2016" "warriors_2019"
#> [9] "wta_matches_2019"Example Datasets
Below are selected example datasets included in the
sportsR package:
atp_matches_2019: reference text.english_football: reference text.italian_football: reference text.
Data Visualization with sportsR Data
PGA
ggplot(pga_results, aes(x = pos, y = sg_total)) +
geom_point(alpha = 0.5, size = 2) +
geom_smooth(
method = "loess",
se = TRUE
) +
scale_x_reverse() +
labs(
title = "Strokes Gained: Total vs. Tournament Position",
subtitle = "PGA Tour Results",
x = "Final Position",
y = "Strokes Gained: Total"
) +
theme_minimal(base_size = 12)
#> `geom_smooth()` using formula = 'y ~ x'
#> Warning: Removed 1994 rows containing non-finite outside the scale range
#> (`stat_smooth()`).
#> Warning: Removed 1994 rows containing missing values or values outside the scale range
#> (`geom_point()`).
Conclusion
The sportsR package provides a comprehensive and diverse collection of sports-related datasets for data analysis, statistical modeling, visualization, and sports analytics. By bringing together information on performance, competitions, rankings, training, physiology, injuries, and other sports disciplines, sportsR offers a practical resource for researchers, students, educators, and data scientists working with sports data.