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

Description Usage Arguments Value See Also Examples

View source: R/web_scraping.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Return event count for 01 January 2015
events <- get_events("2015-01-01", "2015-01-01")

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

BANEScarparkinglite documentation built on July 2, 2018, 1:02 a.m.