Skip to content

PSTAT197-F23/vignette-db-config

Repository files navigation

Football Database Vignette

Vignette on configuring a database and writing queries in R. Example demonstrated using European football data; created as a class project for PSTAT197A in Fall 2023.

Contributors

Ayushmaan Gandhi, Sam Guimte, Maya Hetz, and Mario Tapia-Pacheco

Vignette Abstract

This vignette, created as a final project for PSTAT197A in Fall 2023, provides a detailed guide on configuring a database and writing queries in R, using European football data. The dataset covers the Top 5 leagues in Europe from 2014-2020 and is structured as a relational database with seven separate CSV files: appearances, games, leagues, players, shots, teams, and teamstats. The example demonstrates the process of connecting to a database, adding relations, writing tables, and executing queries to gather relevant data. Additionally, the vignette explores the construction of predictive models in R using the assembled tables.

Repository Contents

  • data: Contains the seven pre-processed CSV files (appearances.csv, games.csv, leagues.csv, players.csv, shots.csv, teams.csv, teamstats.csv) comprising the European Football Database.
  • images: Contains images produced in the files.
  • scripts: Includes R scripts for connecting to the database, adding relations, writing tables, and executing queries.
  • README.md: This file providing an overview of the vignette, contributors, abstract, repository contents, references, and instructions for use and contribution.
  • vignette_db_config.html: Rendered version of the vignette, offering a user-friendly view of the step-by-step guide on configuring a database and executing queries in R with European football data.
  • vignette_db_config.qmd: This file contains the R Markdown source code for the vignette.

Reference List

  1. Kaggle Football Database
  2. Working With SQL Databases From R: Introduction & Connecting To Databases

Instructions for Use

  1. Clone the repository to your local machine.
  2. Install and load the required R packages mentioned in the scripts.
  3. Execute the R scripts in the specified order to configure the database, add relations, write tables, and build predictive models.

Instructions for Contributing

We welcome contributions to enhance this vignette! If you have any suggestions or want to add features, please follow these steps:

  1. Create a new branch for your contribution.
  2. Make your changes and commit them with clear, concise messages.
  3. Push the changes.
  4. Submit a pull request, detailing the changes made and the purpose.

Thank you for contributing!