Learn R Programming

BANEScarparkinglite (version 0.1.2)

get_rugby: Scrape Bath Rugby match dates, kick-off times and results

Description

Web scraping function to gather dates and times of Bath Rugby matches, and whether or not Bath won, from the Bath Rugby website. Note: This function's code is heavily commented so that if you want to, you can use it as a tutorial/guide for writing similar functions of your own! You can view the commented code on the GitHub repo here.

Usage

get_rugby(x)

Arguments

x

A vector of years of seasons to retrieve records from.

Value

A data frame of kick-off date-times and match outcomes.

Examples

Run this code
# NOT RUN {
# Return matches from 2016/17 season
rugby <- get_rugby(2017)
# }
# NOT RUN {
# Return matches from 2014/15, 2015/16 seasons
seasons <- c(2015, 2016)
rugby <- get_rugby(seasons)
# }

Run the code above in your browser using DataLab