7.4 Test your R Might!: Movie data

Table 7.2 contains data about 10 of my favorite movies.

Table 7.2: Some of my favorite movies
movie year boxoffice genre time rating
Whatever Works 2009 35.0 Comedy 92 PG-13
It Follows 2015 15.0 Horror 97 R
Love and Mercy 2015 15.0 Drama 120 R
The Goonies 1985 62.0 Adventure 90 PG
Jiro Dreams of Sushi 2012 3.0 Documentary 81 G
There Will be Blood 2007 10.0 Drama 158 R
Moon 2009 321.0 Science Fiction 97 R
Spice World 1988 79.0 Comedy -84 PG-13
Serenity 2005 39.0 Science Fiction 119 PG-13
Finding Vivian Maier 2014 1.5 Documentary 84 Unrated
  1. Create new data vectors for each column.

  2. What is the name of the 10th movie in the list?

  3. What are the genres of the first 4 movies?

  4. Some joker put Spice World in the movie names – it should be ``The Naked Gun’’ Please correct the name.

  5. What were the names of the movies made before 1990?

  6. How many movies were Dramas? What percent of the 10 movies were Dramas?

  7. One of the values in the time vector is invalid. Convert any invalid values in this vector to NA. Then, calculate the mean movie time

  8. What were the names of the Comedy movies? What were their boxoffice totals? (Two separate questions)

  9. What were the names of the movies that made less than $50 Million dollars AND were Comedies?

  10. What was the median boxoffice revenue of movies rated either G or PG?

  11. What percent of the movies were rated R OR were comedies?