── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.2.1 ✔ readr 2.2.0
✔ forcats 1.0.1 ✔ stringr 1.6.0
✔ ggplot2 4.0.3 ✔ tibble 3.3.1
✔ lubridate 1.9.5 ✔ tidyr 1.3.2
✔ purrr 1.2.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Music Concerts
Load Packages
music_tours <- read_csv("music_tours.csv")glimpse(music_tours)Rows: 20
Columns: 11
$ Rank <dbl> 1, 2, 3, 4, 5, 6, 7, 7, 9, 10, 11, …
$ Peak <chr> "1", "1", "1[4]", "2[7]", "2[4]", "…
$ `All Time Peak` <chr> "2", "7[2]", "2[5]", "10[7]", NA, "…
$ `Actual gross` <chr> "$780,000,000", "$579,800,000", "$4…
$ `Adjusted gross (in 2022 dollars)` <chr> "$780,000,000", "$579,800,000", "$5…
$ Artist <chr> "Taylor Swift", "Beyoncé", "Madonna…
$ `Tour title` <chr> "The Eras Tour †", "Renaissance Wor…
$ `Year(s)` <chr> "2023–2024", "2023", "2008–2009", "…
$ Shows <dbl> 56, 56, 85, 156, 53, 88, 131, 41, 4…
$ `Average gross` <chr> "$13,928,571", "$10,353,571", "$4,8…
$ Ref. <chr> "[1]", "[3]", "[6]", "[7]", "[8]", …
writeLines(names(music_tours))Rank
Peak
All Time Peak
Actual gross
Adjusted gross (in 2022 dollars)
Artist
Tour title
Year(s)
Shows
Average gross
Ref.
music_tours_long <- music_tours %>%
pivot_longer(
cols = matches("gross"),
names_to = "Gross_Type",
values_to = "Revenue"
)# Standardize column names
names(music_tours_long) <- names(music_tours_long) %>%
str_replace_all("\u00A0", " ") %>%
str_to_lower() %>%
str_replace_all("[^a-z0-9]+", "_") %>%
str_remove("_$")music_tours_long <- music_tours_long %>%
mutate(
across(revenue,
~ parse_number(as.character(.x))
)
)artist_revenue <- music_tours_long %>%
group_by(artist) %>%
summarise(
total_revenue = sum(revenue),
number_of_tours = n(),
.groups = "drop"
) %>%
arrange(desc(total_revenue))
artist_revenue# A tibble: 9 × 3
artist total_revenue number_of_tours
<chr> <dbl> <int>
1 Taylor Swift 3228625794 12
2 Madonna 2531830332 12
3 Beyoncé 2257561245 9
4 Pink 1788829399 9
5 Lady Gaga 909122971 6
6 Celine Dion 664070087 3
7 Cher 500291650 3
8 Katy Perry 457207795 3
9 Adele 373572056 3
ggplot(
artist_revenue,
aes(
x = reorder(artist, total_revenue),
y = total_revenue,
fill = artist
)
) +
geom_col() +
coord_flip() +
scale_y_continuous(
labels = scales::label_dollar(
scale = 1e-6,
suffix = "M"
)
) +
labs(
title = "Highest-Grossing Female Music Artists (2002 - 2024)",
x = "Artist",
y = "Total Revenue (Millions of USD)"
) +
theme_minimal()Analysis
Taylor Swift is the highest-grossing artist, earning about $3.2 billion, followed by Madonna and Beyoncé. Pink ranks fourth, while Adele has the lowest revenue. Overall, the chart shows that Taylor Swift, Madonna, and Beyoncé earned much more than the other artists between 2002 and 2024.