Learn R Programming

BANEScarparkinglite (version 0.1.3)

get_events: Scrape the number of advertised events in Bath for each day

Description

Web scraping function to retrieve the number of events advertised at http://www.bath.co.uk/events for each day in a specified range of months. Note: Have a look at this package's GitHub repo - in particular, here - to see the code for this function, along with comments which explain the process followed. See get_rugby for a similar function with more detailed commentary!

Usage

get_events(from, to)

Arguments

from

A date or date-time object, or YYYY-MM-DD string: the first day from which to get an event count.

to

A date or date-time object, or YYYY-MM-DD string: the last day from which to get an event count.

Value

A data frame of daily event counts for each day in the specified range.

See Also

get_events_detail

Examples

Run this code
# NOT RUN {
# Return event count for 01 January 2015
events <- get_events("2015-01-01", "2015-01-01")
# }
# NOT RUN {
# Return daily event counts from 01 Oct 2014 to 17 Jul 2015
events <- get_events("2014-10-01", "2015-07-17")

# Return daily event counts for all months in date range of parking records
raw_data <- get_all_crude()
df <- refine(raw_data)

events <- get_events(min(df$LastUpdate), max(df$LastUpdate))
# }

Run the code above in your browser using DataLab