8.7 Test your R might! Pirates and superheroes

This is a lesser-known superhero named Maggott who could 'transform his body to get superhuman strength and endurance, but to do so he needed to release two huge parasitic worms from his stomach cavity and have them eat things' (http://heavy.com/comedy/2010/04/the-20-worst-superheroes/). Yeah...I'm shocked this guy wasn't a hit.

Figure 8.7: This is a lesser-known superhero named Maggott who could ‘transform his body to get superhuman strength and endurance, but to do so he needed to release two huge parasitic worms from his stomach cavity and have them eat things’ (http://heavy.com/comedy/2010/04/the-20-worst-superheroes/). Yeah…I’m shocked this guy wasn’t a hit.

The following table shows the results of a survey of 10 pirates. In addition to some basic demographic information, the survey asked each pirate “What is your favorite superhero?”” and “How many tattoos do you have?””

Name Sex Age Superhero Tattoos
Astrid F 30 Batman 11
Lea F 25 Superman 15
Sarina F 25 Batman 12
Remon M 29 Spiderman 5
Letizia F 22 Batman 65
Babice F 22 Antman 3
Jonas M 35 Batman 9
Wendy F 19 Superman 13
Niveditha F 32 Maggott 900
Gioia F 21 Superman 0
  1. Combine the data into a single dataframe. Complete all the following exercises from the dataframe!

  2. What is the median age of the 10 pirates?

  3. What was the mean age of female and male pirates separately?

  4. What was the most number of tattoos owned by a male pirate?

  5. What percent of pirates under the age of 32 were female?

  6. What percent of female pirates are under the age of 32?

  7. Add a new column to the dataframe called tattoos.per.year which shows how many tattoos each pirate has for each year in their life.

  8. Which pirate had the most number of tattoos per year?

  9. What are the names of the female pirates whose favorite superhero is Superman?

  10. What was the median number of tattoos of pirates over the age of 20 whose favorite superhero is Spiderman?