The goal of boxoffice
is to scrape movie data to get information about
daily box office results of movies and top grossing movies. It scrapes
the webpages of https://www.the-numbers.com/ for this information.
To install this package, use the code
install.packages("boxoffice")
# The development version is available on Github.
# install.packages("devtools")
devtools::install_github("jacobkap/boxoffice")
The boxoffice()
function gets daily boxoffice information. In essence,
it shows how well each movie performed on that day.
The data it returns are the following:
- Movie name
- The studio that produced that movie
- The daily gross
- Daily percent change in gross
- Number of theaters it is playing in
- Average gross per theater (result of 4 / result of 5)
- Gross-to-date
- How many days the movie has been in theaters
- The date of the data
movies <- boxoffice::boxoffice(date = as.Date("2015-10-31"))
head(movies)
## 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
## 6 Burnt Weinstein Co. 1733927 -5 3003
## 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
## 6 577 3563747 2 2015-10-31
The top_grossing()
function gets the
- Movie name
- Year released
- Total domestic (American market) sales
- Total international sales
- Total sales (domestic + international)
movies <- boxoffice::top_grossing()
## Please note that these numbers are not adjusted for inflation.
head(movies)
## rank movie year_released
## 1 1 Star Wars Ep. VII: The Force Awakens 2015
## 2 2 Avengers: Endgame 2019
## 3 3 Avatar 2009
## 4 4 Black Panther 2018
## 5 5 Avengers: Infinity War 2018
## 6 6 Titanic 1997
## american_box_office international_box_office total_box_office
## 1 936662225 1131561399 2068223624
## 2 858373000 1939427564 2797800564
## 3 760507625 2029197650 2789705275
## 4 700059566 646853595 1346913161
## 5 678815482 1369544272 2048359754
## 6 659363944 1548844451 2208208395