This function collects data from the-numbers’ list of movies ordered by how much money they made. This list is ordered by the total sales in one of three jurisdictions: American(usually called domestic), international, and worldwide (domestic+international). The first parameter, type
, lets you choose which of these jurisdictions you want the data ordered by. The data scraped is the name of the movie, its rank based on the order in the list type you select, and how much it made for all three jurisdictions. The second and only other parameter, ranks
lets you select movies in certain ranks - e.g. the top 10 movies, #s 100-105, etc.
type
The parameter type
lets you choose if you want the list of top grossing movies ordered by sales in “American”, by “international” sales, or “worldwide” sales. As some movies do better out of the America, this results in slightly differed ordering. The default selection is America.
# America
movies <- boxoffice::top_grossing(type = "American")
#> Please note that these numbers are not adjusted for inflation.
head(movies)
#> rank movie year_released
#> 2 1 Star Wars Ep. VII: The Force Awakens 2015
#> 3 2 Avatar 2009
#> 4 3 Black Panther 2018
#> 5 4 Avengers: Infinity War 2018
#> 6 5 Titanic 1997
#> 7 6 Jurassic World 2015
#> american_box_office international_box_office total_box_office
#> 2 936662225 1116648995 2053311220
#> 3 760507625 2015837654 2776345279
#> 4 700059566 647011693 1347071259
#> 5 678815482 1370000000 2048815482
#> 6 659363944 1548844451 2208208395
#> 7 652270625 996622583 1648893208
# International
movies <- boxoffice::top_grossing(type = "international")
#> Please note that these numbers are not adjusted for inflation.
head(movies)
#> rank movie year_released
#> 2 1 Avatar 2009
#> 3 2 Titanic 1997
#> 4 3 Avengers: Infinity War 2018
#> 5 4 Furious 7 2015
#> 6 5 Star Wars Ep. VII: The Force Awakens 2015
#> 7 6 The Fate of the Furious 2017
#> american_box_office international_box_office total_box_office
#> 2 760507625 2015837654 2776345279
#> 3 659363944 1548844451 2208208395
#> 4 678815482 1370000000 2048815482
#> 5 353007020 1165715774 1518722794
#> 6 936662225 1116648995 2053311220
#> 7 225764765 1009143255 1234908020
# Worldwide
movies <- boxoffice::top_grossing(type = "worldwide")
#> Please note that these numbers are not adjusted for inflation.
head(movies)
#> rank movie year_released
#> 2 1 Avatar 2009
#> 3 2 Titanic 1997
#> 4 3 Star Wars Ep. VII: The Force Awakens 2015
#> 5 4 Avengers: Infinity War 2018
#> 6 5 Jurassic World 2015
#> 7 6 Furious 7 2015
#> american_box_office international_box_office total_box_office
#> 2 760507625 2015837654 2776345279
#> 3 659363944 1548844451 2208208395
#> 4 936662225 1116648995 2053311220
#> 5 678815482 1370000000 2048815482
#> 6 652270625 996622583 1648893208
#> 7 353007020 1165715774 1518722794
The ranks
parameter accepts a vector of numbers indicating which rank(s) you want returned. For example using 1-5 will return only the top 5 movies. The default selection is to return ranks 1-100.
movies <- boxoffice::top_grossing()
#> Please note that these numbers are not adjusted for inflation.
head(movies)
#> rank movie year_released
#> 2 1 Star Wars Ep. VII: The Force Awakens 2015
#> 3 2 Avatar 2009
#> 4 3 Black Panther 2018
#> 5 4 Avengers: Infinity War 2018
#> 6 5 Titanic 1997
#> 7 6 Jurassic World 2015
#> american_box_office international_box_office total_box_office
#> 2 936662225 1116648995 2053311220
#> 3 760507625 2015837654 2776345279
#> 4 700059566 647011693 1347071259
#> 5 678815482 1370000000 2048815482
#> 6 659363944 1548844451 2208208395
#> 7 652270625 996622583 1648893208
#
movies <- boxoffice::top_grossing(ranks = 1)
#> Please note that these numbers are not adjusted for inflation.
head(movies)
#> rank movie year_released
#> 2 1 Star Wars Ep. VII: The Force Awakens 2015
#> american_box_office international_box_office total_box_office
#> 2 936662225 1116648995 2053311220
# Worldwide
movies <- boxoffice::top_grossing(ranks = c(1000, 34, 1, 55, 64))
#> Please note that these numbers are not adjusted for inflation.
head(movies)
#> rank movie year_released
#> 2 1 Star Wars Ep. VII: The Force Awakens 2015
#> 35 34 Guardians of the Galaxy Vol 2 2017
#> 56 55 Spider-Man: Homecoming 2017
#> 65 64 Transformers 2007
#> 1019 1000 Star Trek III: The Search for Spock 1984
#> american_box_office international_box_office total_box_office
#> 2 936662225 1116648995 2053311220
#> 35 389813101 472504158 862317259
#> 56 334201140 545869746 880070886
#> 65 319246193 389026399 708272592
#> 1019 76471046 10528954 87000000