These exercises cover the sections of Data wrangling with tidy.

All files can be found in the “dataset” directory.

 

Exercise 8

 

  1. Create a nested dataframe of df1. Specifically only of the two largest groups by common_name, and nest by the common_name.
  2. Create a linear model between length_mm and IGF1_ng_ml using purrr over the nested dataframe. Add the results back to the dataframe
  3. Create a new nested variable containing projections for length_mm based on your linear model (the function predict will be helpful here).