vignettes/get_daily_box_office_info.Rmd
get_daily_box_office_info.Rmd
The boxoffice()
function scrapes information about daily box office results of movies. It scrapes the webpage https://www.the-numbers.com/ for this information. The data it returns are the following:
In essence, it shows how well each movie performed on a given day.
movies <- boxoffice::boxoffice(date = as.Date("2015-10-31"))
dim(movies)
#> [1] 46 9
movies[1:5, ]
#> movie distributor gross percent_change theaters
#> 1 The Martian 20th Century 4564809 31 3218
#> 2 Bridge of Spies Walt Disney 3588796 45 2873
#> 3 Goosebumps Sony Pictures 3326075 9 3618
#> 4 The Last Witch Hunter Lionsgate 2023321 36 3082
#> 5 Hotel Transylvania 2 Sony Pictures 1905762 7 2962
#> per_theater total_gross days date
#> 1 1419 179446657 30 2015-10-31
#> 2 1249 43200132 16 2015-10-31
#> 3 919 53277832 16 2015-10-31
#> 4 656 17377961 9 2015-10-31
#> 5 643 153858782 37 2015-10-31
There are two parameters for boxoffice()
: dates
and top_n
.
dates
are simply an input dates (in Date format) that you want to get information on. In accepts either a single date or a vector of dates. All results are ordered in descending order by how much that movie made on that day. For example, the top selling movie of the day is the first value while the worst selling movie is the last value.
top_n
gives only the top N highest grossing movies for that day. If you want only the top 10 movies that day (ranked by daily movie revenue), you would set top_n
to 10.