![]() # week_ending week_number weekly_gross_ov~ show theatre weekly_gross Then, we count the number of rows in the data frame to see how many consecutive weeks a show has been sold out for. ![]() However, thanks to purrr and the head_while() function, we get back a data frame until a certain condition is not being met. We could do that with a for loop and see if df >= 1 and then have a counter to see for how many weeks that is the case. Next, we want to see if, for each week, the pct_capacity value will be 1 or more. Then I will arrange() all these data frames by week_ending. Now, to see for how many consecutive months each show was sold out, I am splitting the show column, which consists of all the musical names, into a list that contains data frames for each show. Sometimes, the number can be more than one when standing tickets sell. The pct_capacity column contains the percentage of tickets sold / seats in theater. We are interested in the pct_capacity column. # pct_capacity, performances, previews Īs you can see, the data is aggregated by week. # top_ticket_price, seats_sold, seats_in_theatre , with 8 more variables: potential_gross, avg_ticket_price , Data InvestigationĪfter loading the packages and data⦠library(tidyverse) ![]() Maybe it is a surprise that we do not see The Lion King among the top ten since it is the most successful musical in terms of the overall money being spent to watch the musical. Still, the musical was consecutively sold out for almost 2 years. The Harry Potter musical was consecutively sold out since its start in early 2018 until the end of February where there were still some seats left in the theaters. In fact, since its preview, there has not been any performance that has not been sold out completely! Wow! In second place comes Harry Potter and the cursed child. We can clearly see how far ahead Hamilton is.
0 Comments
Leave a Reply. |