Iteration

Author

Jeffrey R. Stevens

Published

March 29, 2023

  1. Write a for loop that calculates the mean bill length for each species in the penguins data set (don’t use group_by()) and saves them as species_means.
# >
  1. Turn #1 into a function called species_mean that lets the user determine which variable to calculate the mean over.
# >
  1. Create a list penguins_island that separates the penguins data by island.
# >
  1. Apply map() to find the number of observations for each year.
# >
  1. Apply map() to calculate the mean body weight for each island.
# >
  1. Rework #5 to return a numeric vector with values rounded to 1 decimal place.
# >