8.7 Test your R might! Pirates and superheroes
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?”"
Combine the data into a single dataframe. Complete all the following exercises from the dataframe!
What is the median age of the 10 pirates?
What was the mean age of female and male pirates separately?
What was the most number of tattoos owned by a male pirate?
What percent of pirates under the age of 32 were female?
What percent of female pirates are under the age of 32?
Add a new column to the dataframe called
tattoos.per.yearwhich shows how many tattoos each pirate has for each year in their life.
Which pirate had the most number of tattoos per year?
What are the names of the female pirates whose favorite superhero is Superman?
What was the median number of tattoos of pirates over the age of 20 whose favorite superhero is Spiderman?