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.
Ayushmaan Gandhi, Sam Guimte, Maya Hetz, and Mario Tapia-Pacheco
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.
- 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.
- Clone the repository to your local machine.
- Install and load the required R packages mentioned in the scripts.
- Execute the R scripts in the specified order to configure the database, add relations, write tables, and build predictive models.
We welcome contributions to enhance this vignette! If you have any suggestions or want to add features, please follow these steps:
- Create a new branch for your contribution.
- Make your changes and commit them with clear, concise messages.
- Push the changes.
- Submit a pull request, detailing the changes made and the purpose.
Thank you for contributing!