Instructions

Answer the following questions and complete the exercises in RMarkdown. Please embed all of your code and push your final work to your repository. Your final lab report should be organized, clean, and run free from errors. Remember, you must remove the # for the included code chunks to run. Be sure to add your name to the author header above.

Make sure to use the formatting conventions of RMarkdown to make your report neat and clean!

Load the libraries

library(tidyverse)
library(janitor)
library(naniar)

Data

For this homework, we will use amniota data from: Myhrvold N, Baldridge E, Chan B, Sivam D, Freeman DL, Ernest SKM (2015). “An amniote life-history database to perform comparative analyses with birds, mammals, and reptiles.” Ecology, 96, 3109. doi: 10.1890/15-0846.1 (URL: https://doi.org/10.1890/15-0846.1).

amniota <- read_csv("data/amniota.csv") %>% 
  clean_names()
  1. Do some exploratory analysis of the amniota data set. Use the function(s) of your choice. Try to get an idea of how NA’s are represented in the data.

  2. Make any necessary replacements in the data such that all NA’s appear as “NA”.

  3. How many total NA’s are in the data set? Use the package naniar to produce a summary, including percentages, of missing data in each column for the amniota data.

  4. Double check your replacement using summary. Do you see any other potential issues? If so, fix them.

  5. Use naniar to visualize the number of NA’s in each variable. Which variables have the most NA’s?

  6. Calculate the number of NAs in the egg_mass_g column sorted by taxonomic class; i.e. how many NA’s are present in the egg_mass_g column in birds, mammals, and reptiles? Does this results make sense biologically? How do these results affect your interpretation of NA’s?

Knit and Upload

Please knit your work as an .html file and upload to Canvas. Homework is due before the start of the next lab. No late work is accepted. Make sure to use the formatting conventions of RMarkdown to make your report neat and clean!