---
title: "sportsR: A Comprehensive Collection of Sports and Athletics Datasets"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{sportsR: A Comprehensive Collection of Sports and Athletics Datasets}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

```{r setup}
library(sportsR)
library(dplyr)
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

```{r sportsR-datasets,echo = TRUE,message = FALSE,warning = FALSE,results = 'markup'}


view_datasets_sportsR()


```

## 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 

```{r sportsRA-plot, fig.width=6, fig.height=4, out.width="100%"}


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)


```


## 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.

<div class="tocify-extend-page" data-unique="tocify-extend-page" style="height: 0;"></div>
